/*
  Projeto: Pórtico Parking
  Desenvolvedor: Enrique
  Data: 16/02/2026 
*/

/**************************INDEX**********************************/
:root {
  --primary: #2563eb;
  --success: #27ae60;
  --danger: #e74c3c;
  --info: #2980b9;
  --dark: #2c3e50;
  --light-blue: #5dade2;
  --bg: #f8fafc;
}

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

body {
  padding-top: 70px;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: #111827;
  line-height: 1.5;
}

/* ====================== HEADER MELHORADO E RESPONSIVO ====================== */
.header {
  background: linear-gradient(90deg, #1f3b64 0%, #274f87 100%);
  color: white;

  position: fixed;
  top: 0;
  left: 0;
  right: 0;

  height: 70px;

  padding: 0 20px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);

  z-index: 1200;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 600;
  white-space: nowrap;
}

.menu-logo {
  height: 42px;
  margin-right: 16px;
  transition: transform 0.2s ease;
}

.menu-logo:hover {
  transform: scale(1.05);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.92rem;
}

.header-right span,
.header-right .notification {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-right .notification i {
  font-size: 1.1rem;
  color: #ffd700;
}

.header-right button#logoutBtn {
  background: rgba(255, 107, 107, 0.9);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.header-right button#logoutBtn:hover {
  background: #ff5252;
  transform: translateY(-1px);
}

/* ====================== RESPONSIVIDADE ====================== */

/* Tablets e telas médias */
@media (max-width: 992px) {
  .header {
    padding: 10px 16px;
    left: 0;
  }

  .header-left {
    font-size: 1.1rem;
  }

  .menu-logo {
    height: 36px;
  }

  .header-title {
    display: none; /* Esconde o título em telas médias para ganhar espaço */
  }

  .header-right {
    font-size: 0.85rem;
    gap: 10px;
  }

  .header-right button#logoutBtn {
    padding: 7px 12px;
    font-size: 0.85rem;
  }
}

/* Mobile pequeno (principalmente celulares) */
@media (max-width: 576px) {
  .header-right {
    width: 100%;
    justify-content: space-between;
    font-size: 0.8rem;
    flex-wrap: wrap;
  }

  .header-right .notification {
    order: 1;
  }

  .header-right span:nth-child(3) {
    /* nome do operador */
    order: 2;
    flex: 1;
    text-align: right;
  }

  .header-right button#logoutBtn {
    order: 3;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .menu-logo {
    height: 32px;
  }
}

.menu-logo {
  height: 38px;
  width: auto;
  margin-right: 4px;
  cursor: pointer;
  user-select: none;
}

.product-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  font-family: "Space Grotesk", "Segoe UI Variable Display", sans-serif;
  line-height: 0.88;
}

.product-brand-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.075em;
}

.product-brand-edition {
  margin-top: 5px;
  color: #7dd3fc;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.36em;
  text-transform: uppercase;
}

@media (max-width: 992px) {
  .product-brand-name { font-size: 1.15rem; }
  .product-brand-edition { font-size: 0.5rem; }
}

@media (max-width: 576px) {
  .product-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-width: 0;
  font-family: "Space Grotesk", "Segoe UI Variable Display", sans-serif;
  line-height: 0.88;
}
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px; /* espaço entre ícone e nome */
  font-size: 0.95rem;
  font-weight: 500;
}

.user-info i {
  font-size: 1.3rem; /* ícone um pouco maior para destaque */
  color: #a0d2ff; /* tom de azul claro para combinar com o header */
  opacity: 0.95;
}

/* Hover suave no ícone/nome (opcional) */
.user-info:hover {
  color: white;
}

.user-info:hover i {
  color: white;
  transform: scale(1.1);
  transition: all 0.2s ease;
}

/* Responsividade: em mobile pequeno, esconde o nome e deixa só o ícone */
@media (max-width: 576px) {
  .user-info {
    font-size: 0.85rem;
    gap: 6px;
  }

  .user-info span {
    /* se quiser esconder o nome em telas muito pequenas */
    display: none;
  }

  .user-info i {
    font-size: 1.4rem; /* ícone maior quando nome some */
  }
}

/* Dashboard */
.dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  padding: 18px 24px;
}

.dash {
  padding: 14px 18px;
  border-radius: 6px;
  color: white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  min-height: 85px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
}

.dash i {
  font-size: 2.2rem;
  opacity: 0.92;
  flex-shrink: 0;
}

.dash .content {
  flex: 1;
}

.dash span {
  font-size: 13px;
  opacity: 0.9;
  display: block;
}

.dash strong {
  font-size: 24px;
  font-weight: 700;
  display: block;
}

.dash.occupied {
  background: var(--danger);
}
.dash.available {
  background: var(--success);
}
.dash.total {
  background: var(--dark);
}
.dash.entries {
  background: var(--info);
}
.dash.exits {
  background: var(--light-blue);
}

/* Main */
.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: 0 24px 24px;
}

@media (max-width: 1100px) {
  .main {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: white;
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
  border-bottom: 1px solid #eee;
  padding-bottom: 8px;
}

/* Formulário - estilos gerais */
.form-row {
  position: relative;
  margin-bottom: 16px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 14px 12px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 15px;
  transition: all 0.2s;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row label {
  position: absolute;
  top: 14px;
  left: 12px;
  color: #666;
  font-size: 14px;
  pointer-events: none;
  transition: all 0.22s ease;
  background: white;
  padding: 0 4px;
}

.form-row input:focus + label,
.form-row input:not(:placeholder-shown) + label,
.form-row select:focus + label,
.form-row select:not([value=""]) + label,
.form-row textarea:focus + label,
.form-row textarea:not(:placeholder-shown) + label {
  top: -8px;
  left: 10px;
  font-size: 12px;
  color: var(--primary);
}

/* Grupos de campos alinhados */
.form-row-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  /*margin-bottom: 16px;*/
}

.form-row-group .form-row {
  flex: 1;
  min-width: 140px;
}

/* Textarea específica */
.form-row textarea {
  resize: vertical;
  min-height: 80px;
}

/* Botões */
.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.btn {
  padding: 10px;
  border: none;
  color: white;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn.green {
  background: var(--success);
}
.btn.red {
  background: var(--danger);
}
.btn.gray {
  background: #7f8c8d;
}
.btn.blue {
  background: var(--primary);
}

/* Câmera */
.camera-img {
  width: 100%;
  border-radius: 6px;
  display: block;
  margin: 12px 0 0;
}

/*.plate-detection {
  margin-top: 8px;
  padding: 12px;
  background: #f1f5f9;
  border-radius: 6px;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  color: #1e40af;
}

.plate-detection strong {
  color: #111827;
  font-size: 1.3em;
}*/

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

.panel-header-camera h3 {
  margin: 0;
}

.plate-detection {
  background: #111827;
  color: #22c55e;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.9rem;
  white-space: nowrap;
}

.camera-time {
  text-align: center;
  margin-top: 8px;
  color: #666;
  font-size: 13px;
}

/* Tabela */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th,
td {
  padding: 10px;
  text-align: left;
}

:root {
  --table-header-color: #555;
}

th {
  background: #f1f3f5;
  font-size: 13px;
  color: var(--table-header-color);
}

td {
  border-bottom: 1px solid #eee;
}

.ok {
  color: var(--success);
  font-weight: bold;
}

/* Borda diferenciada na imagem da câmera */
.camera-img {
  transition: border 0.4s ease;
  border: 4px solid transparent;
  border-radius: 8px;
}

.borda-entrada {
  border-color: #22c55e !important; /* verde */
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

.borda-saida {
  border-color: #ef4444 !important; /* vermelho */
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
}

/* Estilo para tipo na tabela */
table td.entrada {
  color: #22c55e;
  font-weight: 600;
}

table td.saida {
  color: #ef4444;
  font-weight: 600;
}

.placa-mercosul {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 118px;
  min-height: 31px;
  margin: 2px 0;
  padding: 12px 8px 5px;
  border: 1px solid #2f3640;
  border-radius: 5px;
  background: linear-gradient(#1351b4 0 6px, #fff 6px);
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
  color: #111827;
  font-family: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1.4px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

table td.ok {
  color: #22c55e;
}

/**************************LISTA**********************************/

/* Container principal */
.lista-container {
  max-width: 1400px;

  margin-left: var(--sidebar-width);
  margin-right: auto;

  padding: 24px;

  transition: margin-left 0.3s ease;
}

/* Filtros */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.form-row {
  position: relative;
  margin-bottom: 10px;
}

.form-row select,
.form-row input {
  width: 100%;
  padding: 14px 12px 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 15px;
}

.form-row select:focus,
.form-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row label {
  position: absolute;
  top: 14px;
  left: 12px;
  color: #666;
  font-size: 14px;
  pointer-events: none;
  transition: all 0.22s ease;
  background: white;
  padding: 0 4px;
}

.form-row select:focus + label,
.form-row input:focus + label,
.form-row input:not(:placeholder-shown) + label {
  top: -8px;
  left: 10px;
  font-size: 12px;
  color: var(--primary);
}

.btn-filtrar {
  background: var(--primary);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 4px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
}

.btn-filtrar:hover {
  background: #1e40af;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

.table {
  min-width: 0 !important;
  width: 100%;
  table-layout: auto; /* permite que as colunas se ajustem ao conteúdo */
}

@media (max-width: 992px) {
  .table th,
  .table td {
    font-size: 0.9rem;
    padding: 10px 6px;
  }

  .actions-group .btn {
    padding: 5px 8px;
    font-size: 0.85rem;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .table th,
  .table td {
    min-width: 100px; /* evita colunas muito estreitas */
  }

  .table thead {
    display: none; /* opcional: esconde cabeçalho em mobile */
  }

  .table tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: white;
  }

  .table td {
    display: block;
    text-align: right;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    padding-left: 50%;
  }

  .table td:before {
    content: attr(data-label);
    position: absolute;
    left: 10px;
    width: 45%;
    font-weight: bold;
    text-align: left;
    color: var(--table-header-color);
  }
}

th,
td {
  padding: 12px 10px;
  text-align: left;
}

th {
  background: #f1f3f5;
  font-size: 13px;
  color: var(--table-header-color);
  font-weight: 600;
  white-space: nowrap;
}

td {
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

tr:hover {
  background: #f9fafb;
}

.tipo-entrada {
  color: #22c55e;
  font-weight: 600;
}
.tipo-saida {
  color: #ef4444;
  font-weight: 600;
}

.actions-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-edit {
  color: #f59e0b;
}
.btn-edit:hover {
  background: #fec7ca;
}
.btn-delete {
  color: #ef4444;
}
.btn-delete:hover {
  background: #fee2e2;
}

/* Paginação */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.page-btn {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  min-width: 38px;
  text-align: center;
}

.page-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

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

.loading {
  text-align: center;
  padding: 60px 0;
  color: #6b7280;
  font-size: 1.1rem;
}

.no-data {
  text-align: center;
  padding: 40px;
  color: #6b7280;
  font-size: 1.1rem;
}

.actions-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: nowrap;
  width: 100%;
  padding: 6px 0;
}

@media (max-width: 768px) {
  .actions-group {
    gap: 16px; /* mais espaço entre editar e excluir */
  }
}
.actions-group .btn {
  padding: 6px 10px;
  font-size: 0.9rem;
  min-width: 36px;
}

.actions-group .btn i {
  font-size: 1rem;
}

/* Novos filtros alinhados - versão suave */
.filtros-alinhados {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  border: 1px solid #e5e7eb; /* borda bem clara */
}

.filtro-item {
  flex: 1;
  min-width: 200px;
}

.filtro-item input[type="text"],
.filtro-item input[type="date"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #f9fafb;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.filtro-item input:focus {
  outline: none;
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1); /* cinza suave */
  background: #ffffff;
}

.filtro-data {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.separador-data {
  color: #9ca3af;
  font-size: 0.95rem;
  font-weight: 400;
  white-space: nowrap;
}

.filtro-botoes {
  display: flex;
  gap: 8px;
  font-size: 1rem;
}

.filtro-botoes button {
  width: 38px;
  height: 38px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  background: #f9fafb;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
}

#btnAplicarFiltros {
  border-color: #86efac;
  color: #166534;
  background: #f0fdf4;
}

#btnAplicarFiltros:hover {
  background: #dcfce7;
  border-color: #4ade80;
  transform: translateY(-1px);
}

#btnLimparFiltros {
  border-color: #fca5a5;
  color: #991b1b;
  background: #fef2f2;
}

#btnLimparFiltros:hover {
  background: #fee2e2;
  border-color: #f87171;
  transform: translateY(-1px);
}

/* Ícones opcionais mais suaves (se quiser trocar ✓ e ✕ por ícones) */
.filtro-botoes button i {
  font-size: 1rem;
}

/* Responsividade */
@media (max-width: 768px) {
  .filtros-alinhados {
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
  }

  .filtro-data {
    flex-direction: column;
    gap: 8px;
  }

  .separador-data {
    display: none;
  }

  .filtro-botoes {
    flex-direction: row;
    justify-content: center;
    margin-top: 6px;
  }

  .filtro-botoes button {
    width: 42px;
    height: 42px;
  }
}

/* Modal customizado */
.modal-custom {
  position: fixed;
  inset: 0;

  z-index: 1300;

  display: flex;
  align-items: center;

  justify-content: center;

  padding-top: 80px;
  padding-bottom: 20px;

  padding-left: calc(var(--sidebar-width) + 20px);
  padding-right: 20px;
}

body.sidebar-collapsed .modal-custom {
  padding-left: calc(var(--sidebar-collapsed) + 20px);
}

body.sidebar-collapsed .modal-custom {
  left: var(--sidebar-collapsed);
}

.modal-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);

  z-index: 1;
}

.modal-content-custom {
  position: relative;
  z-index: 2;

  background: #fff;
  border-radius: 8px;

  width: 100%;
  max-width: 900px;

  max-height: calc(100vh - 120px);

  overflow: hidden;

  display: flex;
  flex-direction: column;

  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

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

.modal-header-custom {
  background: linear-gradient(90deg, #1f3b64, #274f87);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 8px 8px 0 0;
}

.modal-header-custom h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1.8rem;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s;
}

.modal-close-btn:hover {
  opacity: 1;
}

.modal-body-custom {
   flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.modal-footer-custom {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #f9fafb;
  border-radius: 0 0 8px 8px;
}

.loading-modal {
  text-align: center;
  padding: 20px 0;
  color: var(--primary);
  font-size: 1.05rem;
}

.loading-modal i {
  font-size: 1.8rem;
  margin-right: 10px;
}

@media (max-width: 992px) {
  .modal-custom {
    top: 70px;
    left: var(--sidebar-collapsed);
    right: 0;
    bottom: 0;

    padding: 16px;
  }

  .modal-content-custom {
    width: 100%;
    max-width: calc(100vw - var(--sidebar-collapsed) - 32px);
  }
}

@media (max-width: 768px) {
  .modal-custom {
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;

    padding: 12px;
  }

  .modal-content-custom {
    width: 100%;
    max-width: 100%;
    max-height: calc(100vh - 94px);
  }
}

.camera-container {
  position: relative;
  width: 100%;
  min-height: 300px; /* ajuste conforme o tamanho desejado */
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.camera-img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.4s ease;
}

.aviso-falha {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 2rem;
  max-width: 85%;
  margin: 1rem auto;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;
  border-radius: 8px;
  background: rgba(255, 193, 7, 0.15);
}

.aviso-falha .icone-aviso {
  color: #ffc107;
  margin-bottom: 1rem;
}

.aviso-falha h4 {
  margin: 0.5rem 0 1rem;
  color: #856404;
}

.aviso-falha p {
  margin: 0.5rem 0;
  max-width: 90%;
}

.aviso-falha .detalhe {
  font-size: 0.95rem;
  color: #6c757d;
}

.aviso-falha .btn {
  margin-top: 1rem;
}

/* ====================== SIDEBAR FIXA ====================== */

:root {
  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
}

/* Sidebar fixa */

.sidebar {
  position: fixed;

  top: 70px;
  left: 0;

  width: var(--sidebar-width);

  height: calc(100vh - 70px);

  background: linear-gradient(180deg, #1f3b64 0%, #274f87 100%);

  color: #fff;

  z-index: 1100;

  transition: width 0.3s ease;

  display: flex;
  flex-direction: column;

  overflow-y: auto;
  overflow-x: hidden;
}

/* recolhida */

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-header {
  height: 70px;
  padding: 0 20px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo {
  height: 42px;
}

.sidebar.collapsed .sidebar-logo {
  display: none;
}

/* botão recolher */

.close-sidebar {
  background: none;
  border: none;
  color: white;
  font-size: 1.3rem;
  cursor: pointer;
}

/* menu */

.sidebar-nav {
  flex: 1;
  padding-top: 20px;
}

.sidebar-nav ul {
  list-style: none;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 16px;

  padding: 15px 24px;

  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;

  transition: 0.2s;
}

.menu-group-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.menu-group-chevron {
  min-width: auto !important;
  margin-left: auto;
  font-size: 0.75rem !important;
  transition: transform 0.2s ease;
}

.menu-group-toggle[aria-expanded="true"] .menu-group-chevron {
  transform: rotate(180deg);
}

.submenu {
  display: none;
  margin: 0 14px 8px 30px;
  padding: 2px 0 2px 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.menu-group-toggle[aria-expanded="true"] + .submenu {
  display: block;
}

.submenu-item {
  padding: 10px 14px;
  font-size: 0.94rem;
}

.submenu-item i {
  font-size: 1rem;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.15);
}

.menu-item i {
  min-width: 24px;
  font-size: 1.2rem;
  text-align: center;
}

.sidebar.collapsed .menu-item {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 11px 6px;
  min-height: 62px;
  text-align: center;
}

.sidebar.collapsed .logout-item {
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  text-align: center;
}

.sidebar.collapsed .menu-item span,
.sidebar.collapsed .logout-item span {
  display: -webkit-box;
  max-width: 68px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.64rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.sidebar.collapsed .menu-group-chevron {
  display: none;
}

.sidebar.collapsed .submenu-item {
  padding: 9px 6px;
  min-height: 56px;
}

.sidebar.collapsed .submenu {
  margin: 0 6px 6px;
  padding-left: 0;
  border-left: 0;
  background: rgba(5, 19, 37, 0.2);
}

.sidebar.collapsed .logout-item span {
  color: #ffb3b3;
}

/* logout */

.sidebar-footer {
  padding: 20px;
}

.logout-item {
  display: flex;
  align-items: center;
  gap: 16px;

  text-decoration: none;
  color: #ff8a8a;
}

/* conteúdo */

.dashboard,
.lista-container,
.main {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

body.sidebar-collapsed .dashboard,
body.sidebar-collapsed .lista-container,
body.sidebar-collapsed .main {
  margin-left: var(--sidebar-collapsed);
}

/* overlay não é mais usado */

.sidebar-overlay {
  display: none !important;
}

/* mobile */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    transition: 0.3s;
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .header,
  .dashboard,
  .lista-container,
  .main {
    margin-left: 0 !important;
  }

  .sidebar-overlay {
    display: block !important;
  }

  .sidebar-overlay.active {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1090;
  }
}

@media (min-width: 769px) and (max-width: 992px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }

  .sidebar .menu-item,
  .sidebar .logout-item {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    text-align: center;
  }

  .sidebar .menu-item {
    padding: 11px 6px;
    min-height: 62px;
  }

  .sidebar .menu-item span,
  .sidebar .logout-item span {
    display: -webkit-box;
    max-width: 68px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.64rem;
    font-weight: 600;
    line-height: 1.1;
    text-align: center;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .sidebar .menu-group-chevron {
    display: none;
  }

  .sidebar .submenu-item {
    padding: 9px 6px;
    min-height: 56px;
  }

  .sidebar .submenu {
    margin: 0 6px 6px;
    padding-left: 0;
    border-left: 0;
    background: rgba(5, 19, 37, 0.2);
  }

  .dashboard,
  .lista-container,
  .main{
    margin-left: var(--sidebar-collapsed);
  }
}

/*------------------------------------- TABS modal cliente ---------------------------------- */
* Abas personalizadas */ .custom-tabs {
  margin-bottom: 1.5rem;
}

.tab-headers {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1rem;
}

.tab-header {
  background: none;
  border: none;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  margin-right: 0.5rem;
}

.tab-header:hover {
  color: var(--primary);
}

.tab-header.active {
  color: var(--primary);
  font-weight: 600;
}

.tab-header.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

.tab-contents {
  position: relative;
}

.tab-content {
  display: none;
  padding: 0.5rem 0;
}

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

#tabelaVeiculos td {
  font-size: 14px;
}

.badge-principal {
  background: #22c55e;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.btn-remover-veiculo {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
}

.btn-remover-veiculo:hover {
  color: #b91c1c;
}

/*------------------------------ FIM TABS modal cliente ---------------------------------- */

/* ================= BOTÃO REGISTRO RÁPIDO ================= */

.btn-registro-rapido {
  background: var(--primary); /* mesma cor do botão azul */
  color: white;

  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 15px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-registro-rapido:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-registro-rapido:active {
  transform: translateY(0);
}

.acoes-registro {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ================= FIM BOTÃO REGISTRO RÁPIDO ================= */

#modalNovoRegistro .modal-camera {
  width: 100%;
  max-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.modal-camera img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
}

#modalNovoRegistro .modal-camera img {
  max-width: 100%;
  max-height: 280px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* ==================== AJUSTE DO MODAL NOVO REGISTRO ==================== */

#modalNovoRegistro .modal-content-custom {
  max-height: 88vh; /* Reduz um pouco do máximo */
  height: auto;
}

#modalNovoRegistro .modal-body-custom {
  padding: 18px 24px; /* Reduz padding vertical */
  max-height: calc(88vh - 180px); /* Ajusta espaço para header + footer */
  overflow-y: auto; /* Habilita scroll só no body se precisar */
}

/* Reduz o tamanho da imagem da câmera */
#modalNovoRegistro .modal-camera {
  margin-bottom: 12px;
}

#modalNovoRegistro .modal-camera img {
  max-height: 280px;
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
}

/* Reduz espaçamento entre os grupos de campos */
#modalNovoRegistro .form-row-group {
  margin-bottom: 12px; /* Reduz margem entre linhas */
  gap: 14px;
}

#modalNovoRegistro .form-row {
  margin-bottom: 14px; /* Reduz margem dos campos individuais */
}

#modalNovoRegistro .placa-consulta-row input {
  padding-right: 118px;
}

#modalNovoRegistro .placa-consulta-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  min-height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

#modalNovoRegistro .placa-consulta-btn:hover:not(:disabled) {
  filter: brightness(0.92);
}

#modalNovoRegistro .placa-consulta-btn:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.25);
  outline-offset: 2px;
}

#modalNovoRegistro .placa-consulta-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

#modalNovoRegistro .placa-consulta-btn i {
  margin-right: 5px;
}

#modalNovoRegistro .placa-consulta-status {
  display: block;
  min-height: 16px;
  margin: 4px 2px 0;
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.25;
}

@media (max-width: 576px) {
  #modalNovoRegistro .placa-consulta-row {
    flex: 1 0 100%;
    min-width: 100%;
  }
}

/* Textarea mais compacta */
#modalNovoRegistro #novoObservacoes {
  min-height: 60px; /* Menor que os 80px padrão */
  resize: vertical;
}

/* Footer mais compacto */
#modalNovoRegistro .modal-footer-custom {
  padding: 14px 24px;
}

/* ==================== ESTADIAS============= */
.filtros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.filtro-item-estadia {
  display: flex;
  flex-direction: column;
}

.filtro-item-estadia label {
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
}

.filtro-item-estadia input,
.filtro-item-estadia select {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #dcdcdc;
  font-size: 0.95rem;
}

.acoes-filtro {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.status-badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-aberta {
  background: #d1fae5;
  color: #065f46;
}

.status-finalizada {
  background: #dbeafe;
  color: #1e3a8a;
}

.status-cancelada {
  background: #fee2e2;
  color: #991b1b;
}

.loading-area {
  text-align: center;
  padding: 40px;
  color: #666;
}

/* ==================== ESTADIAS INDICADORES============= */

.indicadores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.indicador-card {
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;

  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #1e88e5;

  transition: 0.2s;
}

.indicador-card:hover {
  transform: translateY(-2px);
}

.indicador-icon {
  width: 52px;
  height: 52px;

  border-radius: 50%;
  background: rgba(30, 136, 229, 0.12);

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  color: #1e88e5;
}

.indicador-label {
  font-size: 13px;
  color: #777;
}

.indicador-valor {
  font-size: 28px;
  font-weight: 700;
  color: #222;
}
/* ==================== FIM ESTADIAS INDICADORES============= */

/* ==================== MODAL PAGAMENTO============= */
.modal-pagamento {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-pagamento-content {
  background: #fff;
  width: min(780px, 100%);
  max-width: 100%;
  max-height: calc(100dvh - 32px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
}

.modal-pagamento-header {
  padding: 18px 22px;
  background: #1f3b64;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-pagamento-header h2 {
  margin: 0;
  font-size: 1.2rem;
}

.modal-pagamento-header button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.modal-pagamento-body {
  padding: 18px 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
}

.pagamento-info {
  background: #f5f7fa;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0;
}

.pagamento-info p {
  margin: 0;
}

.pagamento-resumo {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.pagamento-resumo p:last-child {
  color: #166534;
  font-size: 1.08rem;
}

.pagamento-campo {
  min-width: 0;
}

.pagamento-largura-total,
.pagamento-caixa {
  grid-column: 1 / -1;
}

.pagamento-caixa {
  padding-block: 9px;
  color: #475569;
  font-size: .88rem;
}

.pagamento-subgrid,
.pagamento-point-opcoes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  align-items: end;
}

.pagamento-point-opcoes .pagamento-point-status,
.pagamento-point-opcoes #pagamentoPointSandbox {
  min-width: 0;
}

.modal-pagamento-body label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.modal-pagamento-body select,
.modal-pagamento-body input:not([type="checkbox"]) {
  width: 100%;
  padding: 11px;
  border: 1px solid #ccc;
  border-radius: 8px;
  min-height: 42px;
  box-sizing: border-box;
}
.modal-pagamento-body .opcao-impressao {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.opcao-impressao input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #198754;
}

.opcao-impressao span,
.opcao-impressao strong,
.opcao-impressao small {
  display: block;
}

.opcao-impressao small {
  margin-top: 3px;
  color: #64748b;
  font-weight: 400;
}

.modal-pagamento-footer {
  padding: 13px 22px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #eee;
}

#btnCancelarPagamento {
  background: #6c757d;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

#btnConfirmarPagamento {
  background: #198754;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-pagar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  white-space: nowrap;
  background: #198754;
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-pagar:disabled {
  background: #aaa;
  cursor: not-allowed;
}

.status-paga {
  background: #0d6efd;
  color: #fff;
}
/* ==================== FIM MODAL PAGAMENTO============= */

.tabs-nvr {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
}

.tab-nvr {
  border: none;
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: #666;
  border-bottom: 3px solid transparent;
}

.tab-nvr.active {
  color: #1f3b64;
  border-bottom-color: #1f3b64;
}

.tab-content-nvr {
  display: none;
}

.tab-content-nvr.active {
  display: block;
}

#formCameraBox {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

#cameraFormTitulo {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1f3b64;
}

.sidebar-footer .app-version {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 4px;
  color: #c3d1e3;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sidebar.collapsed .app-version-label { display: none; }
@media (min-width: 769px) and (max-width: 992px) {
  .sidebar .app-version-label { display: none; }
}
.sidebar-footer .app-version[hidden] { display: none; }

/* Ajustes globais para notebooks compactos, tablets e celulares. */
@media (max-width: 1200px) {
  .dashboard,
  .lista-container,
  .main {
    padding-left: 20px;
    padding-right: 20px;
  }

  .filters {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }
}

@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body { padding-top: 64px; }

  .header {
    height: 64px;
    min-width: 0;
  }

  .header-left,
  .header-right { min-width: 0; }

  .menu-logo {
    height: 34px;
    flex: 0 0 auto;
  }

  .sidebar {
    top: 64px;
    height: calc(100vh - 64px);
  }

  .dashboard,
  .lista-container,
  .main {
    width: auto;
    max-width: 100%;
    padding-left: 16px;
    padding-right: 16px;
  }

  .lista-container { padding-top: 18px; }
  .dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .panel-header-flex,
  .acoes-registro,
  .modal-header-custom {
    flex-wrap: wrap;
    gap: 10px;
  }

  .form-row-group { flex-direction: column; }
  .form-row-group > * { width: 100%; min-width: 0; }

  .table-responsive {
    max-width: 100%;
    overscroll-behavior-inline: contain;
  }

  .modal-custom { top: 64px; }
  .modal-header-custom,
  .modal-body-custom,
  .modal-footer-custom { padding-inline: 18px; }

  .modal-pagamento-body,
  .pagamento-subgrid,
  .pagamento-point-opcoes { grid-template-columns: 1fr; }

  .pagamento-resumo {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .pagamento-point-opcoes .pagamento-point-status,
  .pagamento-point-opcoes #pagamentoPointSandbox { grid-column: auto; }
}

@media (max-width: 576px) {
  .header { padding-inline: 10px; }
  .menu-logo { height: 30px; }
  .product-brand-name { font-size: 1rem; }
  .product-brand-edition { margin-top: 3px; font-size: .43rem; }

  .dashboard,
  .indicadores-grid { grid-template-columns: 1fr; }

  .dashboard,
  .lista-container,
  .main {
    padding-left: 12px;
    padding-right: 12px;
  }

  .panel { padding: 14px; }
  .filters,
  .filtros-grid { grid-template-columns: 1fr; gap: 12px; }

  .modal-footer-custom,
  .modal-pagamento-footer { flex-direction: column-reverse; }

  .modal-footer-custom .btn,
  .modal-pagamento-footer button { width: 100%; }

  .modal-pagamento { padding: 12px; }
  .modal-pagamento-content { max-height: calc(100dvh - 24px); }
}

.pagamento-point-status { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: #eef5ff; color: #245b9e; font-size: .82rem; font-weight: 700; }
.pagamento-point-status:empty { display: none; }
#pagamentoPointSandbox, #mensalidadePointSandbox { margin-top: 10px; padding: 10px; border: 1px dashed #93b8e6; border-radius: 8px; background: #f7fbff; }
#pagamentoPointSandbox select, #mensalidadePointSandbox select { margin-bottom: 8px; }
.pagamento-point-opcoes .pagamento-point-status { margin-top: 0; }
.pagamento-point-opcoes #pagamentoPointSandbox { grid-column: 1 / -1; margin-top: 0; }
.pagamento-point-opcoes #pagamentoPointSandbox:not([hidden]) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.pagamento-point-opcoes #pagamentoPointSandbox select { margin-bottom: 0; }
@media (max-width: 768px) {
  .pagamento-point-opcoes #pagamentoPointSandbox:not([hidden]) { grid-template-columns: 1fr; }
}
#terminalForm .form-row small { display: block; margin-top: 5px; color: #718096; font-size: .72rem; }
