/* ===== Cursor ===== */
/* Nunca o cursor de texto ("I"): tudo herda o normal e só o que é clicável leva a
   mãozinha. Com "inherit" (e não "*: default") os filhos de um botão/cartão clicável
   mantêm o pointer do pai. Os campos continuam a funcionar (o cursor de escrita
   dentro do campo aparece na mesma). */
html {
  cursor: default;
}

*,
*::before,
*::after {
  cursor: inherit;
}

a[href],
button,
summary,
select,
[role="button"],
[role="option"],
[onclick],
label[for],
label:has(input[type="checkbox"]),
input[type="checkbox"],
input[type="radio"],
input[type="date"],
input[type="time"],
.cursor-pointer {
  cursor: pointer;
}

:disabled,
[aria-disabled="true"],
.cursor-not-allowed {
  cursor: not-allowed;
}

 .shimmer {
      background: linear-gradient(
          90deg,
          rgba(255, 255, 255, 0.05) 25%,
          rgba(255, 255, 255, 0.15) 50%,
          rgba(255, 255, 255, 0.05) 75%);
      background-size: 200% 100%;
      animation: shimmer 1.2s linear infinite;
    }

    .row-loading {
      opacity: .5;
      pointer-events: none;
      filter: grayscale(40%);
      position: relative;
    }

    .row-loading::after {
      content: '';
      position: absolute;
      right: 1rem;
      top: 50%;
      width: 14px;
      height: 14px;
      margin-top: -7px;
      border: 2px solid rgba(255, 255, 255, .3);
      border-top-color: white;
      border-radius: 50%;
      animation: spin .8s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

/* ===== Barra lateral ===== */

/* Itens de navegação (o "Nova reserva" é .menu-action e tem estilo próprio no HTML).
   Não têm fundo próprio: o fundo é o #nav-indicator, que desliza entre eles. */
.menu-btn:not(.menu-action) {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  text-align: left;
  color: #8FA2C6;
  transition: color 0.2s ease;
}

.menu-btn:not(.menu-action) i {
  width: 1rem;
  text-align: center;
  font-size: 0.85rem;
}

.menu-btn:not(.menu-action):hover,
.menu-btn.active {
  color: #E6EBF4;
}

/* A aba ativa tem o SEU fundo, fixo — o #nav-indicator é só o hover que desliza
   por cima dos itens, por isso nunca se perde de vista em que aba se está. */
.menu-btn.active {
  cursor: default;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.menu-btn.active i {
  color: #60A5FA;
}

/* Contador em vidro (âmbar translúcido + blur + reflexo de 1px) — o mesmo no item
   Dashboard do menu e no título "Pendentes" do Dashboard */
.glass-badge,
#nav-pending-badge {
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.4375rem;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(253, 230, 138, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: #FDE68A;
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

#nav-pending-badge {
  margin-left: auto;
}

#nav-pending-badge:not(.hidden) {
  display: inline-flex;
}

/* menu recolhido: o contador passa a ponto no canto do ícone */
#sidebar.collapsed #nav-pending-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  font-size: 9px;
}

#nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.25rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.045);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.2s ease;
}

/* Na primeira colocação (e ao recolher/expandir) não anima — só aparece no sítio */
#nav-indicator.no-anim {
  transition: none;
}

    ::-webkit-scrollbar {
      width: 8px;
      height: 8px;
    }

    ::-webkit-scrollbar-track {
      background: transparent;
    }

    ::-webkit-scrollbar-thumb {
      background-color: #223A6B;
      /* borderSubtle */
      border-radius: 999px;
      transition: background-color 0.2s ease;
    }

    ::-webkit-scrollbar-thumb:hover {
      background-color: #2563EB;
    }


    ::-webkit-scrollbar-thumb:active {
      background-color: #1D4ED8;
    }


    #res-people {
      transition: transform 0.12s ease;
    }


    .toast {
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.toast-enter {
  transform: translateX(100%);
  opacity: 0;
}
.toast-show {
  transform: translateX(0);
  opacity: 1;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  scrollbar-width: none;
}
.table-card {
  transition: all 0.25s ease;
  /* toque longo = arrastar para juntar mesas: sem seleção de texto nem menu do iOS */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.table-expanded {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

.btn-touch {
  transition: transform 0.1s ease, background 0.1s ease;
}

.btn-touch:active {
  transform: scale(0.9);
}
.table-fade-out {
  opacity: 0;
  transform: scale(0.95);
  transition: all 0.2s ease;
}

.table-fade-in {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
/* cartões da grelha de mesas — abrem o detalhe ao clicar */
[data-card] {
  cursor: pointer;
}

#bottom-time {
  letter-spacing: 0.03em;
}

#bottom-bar {
  border: 1px solid rgba(255,255,255,0.05);
}

/* ===== Vidro (glassmorphism discreto) ===== */
/* .glass = painel principal (com blur); .glass-soft = linhas/cartões dentro de um
   painel (sem blur — blur dentro de blur pesa e não se vê). O vidro só se nota com
   algo por trás: .ambient-bg põe uma luz muito suave no fundo da vista. */

.glass {
  background: rgba(255, 255, 255, 0.035);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.glass-soft {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.glass-soft.is-clickable:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: rgba(255, 255, 255, 0.1);
}

.ambient-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px circle at 12% -10%, rgba(37, 99, 235, 0.14), transparent 60%),
    radial-gradient(600px circle at 95% 110%, rgba(143, 162, 198, 0.09), transparent 60%);
}

/* cabeçalho de grupo fixo dentro de um painel de vidro */
.glass-sticky {
  background: rgba(17, 30, 64, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ===== Data clicável (Histórico / Reservas — abre o seletor de data) ===== */

.date-trigger {
  padding: 0.375rem 0.875rem;
  border-radius: 0.625rem;
  transition: background-color 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.date-trigger > * {
  transition: color 0.25s ease;
}

.date-trigger:hover {
  background-color: rgba(255, 255, 255, 0.06);
}

.date-trigger:hover #dp-year {
  color: #E6EBF4;
}

.date-trigger:active {
  transform: scale(0.97);
}

/* ===== Toasts (ui.js: showToast) ===== */

.app-toast {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 39, 82, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 32px -12px rgba(0, 0, 0, 0.5);
}

/* ===== Tooltips (ui.js: tooltips personalizados) ===== */
/* Substituem o tooltip nativo de qualquer elemento com title. */

.app-tooltip {
  position: fixed;
  z-index: 200;
  max-width: 16rem;
  padding: 0.375rem 0.625rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(17, 39, 82, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: #E6EBF4;
  font-size: 0.75rem;
  line-height: 1.35;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.app-tooltip.is-below {
  transform: translateY(-3px);
}

.app-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Estado vazio (utilities.js: emptyState) ===== */

.empty-state {
  animation: emptyFadeIn 0.35s ease both;
}

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

/* ===== Botões ===== */
/* Sistema único para toda a app — usar sempre estas classes em botões novos.
   .btn + variante (.btn-primary | .btn-secondary | .btn-ghost | .btn-danger),
   tamanhos .btn-sm / .btn-block; .btn-icon para botões só com ícone
   (+ .is-outline com contorno, + .is-danger / .is-success para a cor no hover). */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.25rem;
  padding: 0 1rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.btn:focus-visible,
.btn-icon:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45);
}

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

.btn i {
  font-size: 0.75rem;
}

.btn-sm {
  height: 1.875rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

/* Vidro: fundo translúcido (cor de fundo, para a transição ser suave), blur,
   borda fina clara e um reflexo de 1px no topo (inset). Sem sombras exteriores
   nem brilhos — o "morphism" fica na superfície, não à volta dela. */

.btn-primary,
.btn-secondary,
.btn-danger {
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
              box-shadow 0.2s ease, transform 0.1s ease, opacity 0.15s ease;
}

.btn-primary:active:not(:disabled),
.btn-secondary:active:not(:disabled),
.btn-danger:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary {
  background-color: rgba(59, 130, 246, 0.26);
  border-color: rgba(147, 197, 253, 0.3);
  color: #EFF6FF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-primary:hover:not(:disabled) {
  background-color: rgba(59, 130, 246, 0.38);
  border-color: rgba(147, 197, 253, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: #E6EBF4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

.btn-secondary.is-success:hover:not(:disabled) {
  color: #6EE7B7;
  border-color: rgba(52, 211, 153, 0.35);
  background-color: rgba(52, 211, 153, 0.1);
}

.btn-secondary.is-danger:hover:not(:disabled) {
  color: #FCA5A5;
  border-color: rgba(248, 113, 113, 0.35);
  background-color: rgba(248, 113, 113, 0.1);
}

.btn-ghost {
  background: transparent;
  color: #8FA2C6;
}

.btn-ghost:hover:not(:disabled) {
  color: #E6EBF4;
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background-color: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
  color: #FCA5A5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn-danger:hover:not(:disabled) {
  background-color: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.5);
}

/* o foco por teclado mantém o reflexo do vidro */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Juntar mesas: vidro azul-céu (a 1.ª cor das mesas juntas no mapa, JOIN_COLORS), para
   não se confundir com a ação principal (.btn-primary, azul) — usar com <i fa-link> */
.btn-join {
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  background-color: rgba(56, 189, 248, 0.16);
  border-color: rgba(125, 211, 252, 0.35);
  color: #E0F2FE;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
              box-shadow 0.2s ease, transform 0.1s ease, opacity 0.15s ease;
}

.btn-join:hover:not(:disabled) {
  background-color: rgba(56, 189, 248, 0.26);
  border-color: rgba(125, 211, 252, 0.5);
}

.btn-join:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-join:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 2px rgba(56, 189, 248, 0.5);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
  color: #8FA2C6;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-icon i {
  font-size: 0.75rem;
}

.btn-icon:hover:not(:disabled) {
  color: #E6EBF4;
  background: rgba(255, 255, 255, 0.06);
}

.btn-icon.is-outline {
  border-color: rgba(255, 255, 255, 0.1);
}

.btn-icon.is-outline:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.btn-icon.is-danger:hover:not(:disabled) {
  color: #FCA5A5;
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.3);
}

/* ===== Campos ===== */
/* Campo de formulário padrão da app (input, textarea, e botões com ar de campo). */

.field {
  display: block;
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #E6EBF4;
  font-size: 0.875rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.field::placeholder {
  color: rgba(143, 162, 198, 0.6);
}

.field:focus {
  outline: none;
  border-color: rgba(37, 99, 235, 0.6);
  background: rgba(255, 255, 255, 0.05);
}

textarea.field {
  height: auto;
  padding: 0.625rem 0.75rem;
  resize: vertical;
}

/* ===== Controlo segmentado (Configurações, Reservas Dia/Mês) ===== */

.seg-tab,
.settings-tab {
  height: 2.125rem;
  padding: 0 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  white-space: nowrap;
  color: #8FA2C6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.seg-tab:hover,
.settings-tab:hover {
  color: #E6EBF4;
}

.seg-tab.is-active,
.settings-tab.is-active {
  background: rgba(255, 255, 255, 0.08);
  color: #E6EBF4;
}

/* ===== Reservas — vista mensal ===== */

.month-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 4rem;
  padding: 0.5rem;
  border-radius: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.015);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

@media (min-width: 768px) {
  .month-cell {
    min-height: 5.75rem;
    padding: 0.625rem 0.75rem;
  }
}

.month-cell:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.month-cell.has-items {
  background: rgba(255, 255, 255, 0.04);
}

.month-cell.is-today {
  border-color: rgba(96, 165, 250, 0.55);
}

.month-cell.is-past {
  opacity: 0.55;
}

.month-cell .month-day {
  font-size: 0.75rem;
  color: #8FA2C6;
}

.month-cell.is-today .month-day {
  color: #E6EBF4;
  font-weight: 600;
}

.month-cell .month-count {
  margin-top: auto;
  font-size: 1.125rem;
  line-height: 1;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: #E6EBF4;
}

@media (min-width: 768px) {
  .month-cell .month-count {
    font-size: 1.5rem;
  }
}

.month-cell .month-label {
  margin-top: 0.25rem;
  font-size: 10px;
  color: #8FA2C6;
  display: none;
}

@media (min-width: 768px) {
  .month-cell .month-label {
    display: block;
  }
}

.month-cell .month-pending {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 999px;
  background: #FACC15;
}

/* ===== Planta do mapa de mesas ===== */
/* Na planta a célula manda no tamanho (fitPlanGrids, restaurant_tables.js): o cartão
   enche-a, sem aspect-square nem altura mínima. Com células pequenas (muitas colunas
   ou linhas para caber no ecrã) esconde-se o secundário por container queries —
   os botões Chegou/Faltou mantêm sempre os 48 px. */
.plan-cell {
  container-type: size;
  min-width: 0;
  min-height: 0;
}

.plan-cell > .table-card {
  aspect-ratio: auto;
  min-height: 0;
  height: 100%;
}

@container (max-height: 165px) {
  .table-card-big {
    font-size: 1.25rem;
  }
}

@container (max-height: 135px) {
  .table-card-meta {
    display: none;
  }
}

/* cartões com botões de toque (ocupada → Terminar): em células baixas o rodapé
   ("Próx. 21:00") dá lugar ao botão; nos livres o rodapé é a informação e fica */
@container (max-height: 160px) {
  .table-card:has(.btn-touch) .table-card-foot {
    display: none;
  }
}

/* estreito: fica só o ponto de cor do estado (o nome da mesa precisa do espaço) */
@container (max-width: 135px) {
  .table-card-chip-label {
    display: none;
  }
}

/* ===== Linha do tempo (mapa de mesas) ===== */
/* <input type="range"> desenhado por nós: calha fina lisa e "polegar" redondo com o
   acento; 18px de polegar + área de toque de 36px (h-9 no contentor) para o tátil. */
.timeline-range {
  -webkit-appearance: none;
  appearance: none;
  height: 2.25rem;
  background: transparent;
  cursor: pointer;
}

.timeline-range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.10);
}

.timeline-range::-moz-range-track {
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.10);
}

.timeline-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -7px;
  border-radius: 9999px;
  background: #2563EB;
  border: 2px solid #E6EBF4;
}

.timeline-range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  background: #2563EB;
  border: 2px solid #E6EBF4;
}

.timeline-range:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
  border-radius: 0.5rem;
}

/* ===== Checkbox ===== */
/* Todas desenhadas por nós (appearance: none): caixa lisa com borda fina e, marcada,
   acento azul com o visto em SVG. O <input> continua a ser o verdadeiro, por isso
   .checked, change e teclado funcionam como antes. */
input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  border-radius: 0.375rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03) center / 0.75rem no-repeat;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

input[type="checkbox"]:hover {
  border-color: rgba(255, 255, 255, 0.35);
}

input[type="checkbox"]:checked {
  background-color: #2563EB;
  border-color: #2563EB;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5'/%3E%3C/svg%3E");
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.6);
  outline-offset: 2px;
}

input[type="checkbox"]:disabled {
  opacity: 0.4;
}

/* Linha clicável inteira: <label class="check-row"><input type="checkbox"> <span>…</span></label>
   Clicar em qualquer ponto da linha marca/desmarca (é o próprio <label>). */
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.875rem;
  line-height: 1.25rem;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.check-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.check-row:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.08);
}

.check-row input[type="checkbox"] {
  margin-top: 0.0625rem;
}

.check-row-hint {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: #8FA2C6;
}

/* os pickers nativos de data/hora abrem no tema escuro */
input[type="date"],
input[type="time"] {
  color-scheme: dark;
}

/* ===== Dropdowns customizados (ui.js: enhanceSelect) ===== */
/* O mesmo visual serve os <select> melhorados e o filtro de hora do Dashboard. */

.cselect {
  position: relative;
  display: inline-block;
  min-width: 9rem;
}

.cselect.is-block {
  display: block;
}

.cselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.cselect-trigger:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.cselect-trigger:focus-visible {
  outline: none;
  border-color: #2563EB;
}

.cselect-trigger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cselect-trigger .cselect-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ícone opcional da opção (data-icon) — ex.: círculo com a cor do estado */
.cselect-icon {
  font-size: 7px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.cselect-trigger .cselect-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.cselect-chevron {
  font-size: 10px;
  color: #8FA2C6;
  transition: transform 0.2s ease;
}

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

.cselect-menu {
  z-index: 100;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #112752;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.cselect-menu.is-up {
  transform: translateY(4px);
}

.cselect-menu.is-open {
  opacity: 1;
  transform: translateY(0);
}

.cselect-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  text-align: left;
  color: #8FA2C6;
  cursor: pointer;
  white-space: nowrap;
}

.cselect-option:hover,
.cselect-option.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: #E6EBF4;
}

.cselect-option.is-selected {
  color: #E6EBF4;
}

.cselect-option .cselect-check {
  font-size: 10px;
  color: #E6EBF4;
  visibility: hidden;
}

.cselect-option.is-selected .cselect-check {
  visibility: visible;
}

.cselect-option[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Seta de recolher/expandir: roda 180° e, ao passar o rato, dá um pequeno
   empurrão no sentido para onde o menu vai */
#sidebar-toggle-icon {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#sidebar-toggle-btn:hover #sidebar-toggle-icon {
  transform: translateX(-2px);
}

#sidebar.collapsed #sidebar-toggle-icon {
  transform: rotate(180deg);
}

#sidebar.collapsed #sidebar-toggle-btn:hover #sidebar-toggle-icon {
  transform: rotate(180deg) translateX(-2px);
}

/* Recolhida (só desktop): fica só com ícones; os "title" dos botões servem de tooltip */
#sidebar.collapsed .sb-label {
  display: none;
}

#sidebar.collapsed .menu-btn {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

#sidebar.collapsed #sidebar-header {
  justify-content: center;
}

#sidebar.collapsed #sidebar-user > button {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}

#sidebar.collapsed #sidebar-user > div {
  flex-direction: column;
  gap: 0.5rem;
}


.michelin-spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(198, 166, 75, 0.1);
  border-top: 2px solid #C6A64B;
  border-right: 2px solid #E7D39F;
  animation: michelinSpin 1s ease-in-out infinite;
}

@keyframes michelinSpin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.05) 25%,
    rgba(255,255,255,0.12) 50%,
    rgba(255,255,255,0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}


@keyframes connectionPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
  }
  50% {
    box-shadow: 0 0 12px 4px rgba(239, 68, 68, 0.1);
  }
}

.connection-pulse {
  animation: connectionPulse 2s ease-in-out infinite;
}


