﻿@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/choices.js/public/assets/styles/choices.min.css');

:root {
  --vz-font-family-primary: "Poppins", sans-serif;
  --vz-font-family-secondary: "Poppins", sans-serif;
  --vz-headings-font-family: "Poppins", sans-serif;
  --vz-headings-font-weight: 600;
  --vz-body-font-family: "Poppins", sans-serif;
  --vz-body-bg: #1f2328;
  --vz-body-color: #cbd5e1;
  --vz-border-color: #2a3038;
  --vz-heading-color: #e2e8f0;
  --vz-card-bg-custom: #232830;
  --vz-card-border-custom: #2a3038;

  --primary: #3577f1;
  --primary-dark: #2f6fdc;
  --primary-light: #283142;
  --accent: #687cfe;
  --success: #0ab39c;
  --danger: #f46a6a;
  --warning: #f1b44c;
  --text-main: #ced4da;
  --text-light: #ffffff;
  --text-muted: #878a99;
  --bg-main: #1a1d21;
  --bg-card: #1a1d21;
  --bg-card-dark: #1a2330;
  --bg-table-even: #212b3a;
  --shadow: 0 4px 12px rgba(0,0,0,.18);

  /* Tokens de cartão e tipografia comuns */
  --card-bg: var(--bg-card);
  --card-border: #2a3038;
  --card-shadow: var(--shadow);
  --card-radius: 6px;
  --card-hover-shadow: 0 5px 20px rgba(34,116,165,0.15);
  --text-strong: var(--text-main);
  --text-secondary: var(--text-muted);

  /* Variáveis para .form-page-form inputs (Light Mode Defaults) */
  --form-page-input-bg: #212529;
  --form-page-input-text: #e2e8f0;
  --form-page-input-border: #343a40;
  --form-page-input-focus-bg: #212529;
  --form-page-input-focus-border: #556ee6;
  --form-page-input-disabled-bg: #212529;
  --form-page-input-disabled-text: #9aa4b2;
  --form-page-input-disabled-border: #343a40;

  /* Tokens comuns de cartões/painéis */
  --card-bg: var(--bg-card);
  --card-border: #32383e;
  --card-shadow: var(--shadow);
  --card-hover-shadow: 0 5px 20px rgba(34,116,165,0.15);
  --card-radius: 6px;
  --text-strong: var(--text-main);
  --text-secondary: var(--text-muted);

  /* Bridges para CSS específicos (ferias.css) */
  --primary-color: var(--primary);
  --primary-color-light: var(--primary-light);
  --text-color: var(--text-main);
  --text-color-secondary: var(--text-muted);
  --border-color: var(--card-border);
  --background-color-light: var(--bg-card);
  --background-color-hover: var(--bg-table-even);

  /* Sidebar (estilo Velzon) */
  --sidebar-bg: #212529;
  --sidebar-bg-2: #212529;
  --sidebar-border: #2b3746;
  --sidebar-title: #7c7f90;
  --sidebar-item: #7c7f90;
  --sidebar-item-hover: #cfd7e3;
  --sidebar-item-active: #ffffff;
  --sidebar-active-bg: rgba(255, 255, 255, 0.06);
  --sidebar-active-border: transparent;
}

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--vz-body-font-family);
  color: var(--text-main);
  background: var(--bg-main);
  min-height: 100vh;
  transition: background .3s;
}
h1, h2, h3, h4, h5, h6 {
  font-family: var(--vz-headings-font-family);
}

/* HEADER */
.header-fixo {
  background: var(--primary);
  color: var(--text-light);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99;
  box-shadow: 0 3px 18px rgba(34,116,165,0.13);
  font-size: 1em;
}
.header-logo img {
  height: 50px;
  margin-right: 12px;
  vertical-align: middle;
}
.header-logo {
  font-size: 1.15rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: .02em;
}
.header-utilizador {
  font-size: 1.06rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.menu-mobile-toggle {
  display: none; /* Escondido em desktop por defeito */
  background: transparent;
  border: none;
  color: var(--text-light); /* Cor do ícone, assume header com fundo escuro */
  font-size: 1.6rem; /* Ajustar conforme necessário */
  cursor: pointer;
  padding: 0.5rem; /* Área de clique */
}


/* MENU LATERAL */
.menu-lateral {
  position: fixed;
  left: 0; top: 64px; bottom: 0;
  width: 236px;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 0 10px;
  z-index: 90;
  transition: width .3s;
  font-family: var(--vz-body-font-family);
}
.menu-lateral a {
  padding: 12px 14px;
  color: var(--sidebar-item);
  text-decoration: none;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-weight: 500;
  letter-spacing: .01em;
  transition: background .13s, color .13s, border-color .16s;
}
.menu-lateral a.active, .menu-lateral a:hover {
  background: rgba(255, 255, 255, 0.045);
  color: var(--sidebar-item-hover);
}
.menu-lateral a.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-item-active);
  border-color: rgba(255,255,255,0.06);
  box-shadow: none;
}
.menu-lateral a .fa,
.menu-lateral a .fas,
.menu-lateral a .far,
.menu-lateral a .fa-solid,
.menu-lateral a .fa-regular {
  width: 22px;            /* largura fixa para alinhar todos os textos */
  flex: 0 0 22px;         /* não encolhe, não cresce */
  text-align: center;     /* centra o ícone dentro da largura fixa */
  font-size: 0.95rem;
  margin-right: 0;        /* o espaçamento já é dado por gap no flex */
}
.menu-lateral .txt { flex: 1; }
.menu-section-title {
  margin: 10px 8px 8px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sidebar-title);
  font-weight: 600;
  font-family: var(--vz-body-font-family);
}

/* MAIN */
.dashboard-main {
  margin-left: 236px;
  padding: 80px 18px 40px 18px;
  min-height: 100vh;
  background: var(--bg-main);
  transition: background .3s;
}
.overlay-menu {
  display: none; /* Escondido por defeito */
  position: fixed;
  inset: 0; /* Cobre a tela toda */
  background: rgba(0,0,0,0.45);
  z-index: 1000; /* Abaixo do menu lateral, acima do conteúdo principal */
}
/* Mostrar overlay quando o menu está aberto */
.menu-lateral.open + .overlay-menu {
  display: block;
}
.container {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 32px 32px 28px 32px;
  margin-bottom: 40px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  color: var(--text-main);
  width: 100%;
}

h3 {
  margin-top: 0;
  font-weight: 700;
  color: var(--primary-dark);
  font-size: 1.16rem;
  margin-bottom: 21px;
}

/* Utilitários de painel (para uniformizar blocos em todas as páginas) */
.panel {
  background: var(--card-bg);
  color: var(--text-main);
  border-radius: var(--card-radius);
  padding: 16px;
  margin-bottom: 16px; /* Espaçamento consistente entre painéis */
}
.panel-header {
  padding: 8px 12px 12px 12px;
  margin: -16px -16px 12px -16px; /* estende até às bordas do painel */
  border-bottom: 1px solid var(--card-border);
  background: transparent;
  font-weight: 800;
  color: var(--text-strong);
  font-size: 1.06rem; /* Uniformiza h2/h3 com a mesma escala */
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-header i { color: var(--primary); }
.panel-actions { display: flex; gap: .5rem; align-items: center; }

/* Variantes de botão opcionais (não afetam .btn existente) */
.btn--primary { background: var(--primary); color: var(--text-light); border: 1px solid var(--primary); }
.btn--primary:hover { background: var(--primary-dark); }
.btn--secondary { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn--secondary:hover { background: var(--primary-light); }
.btn--ghost { background: transparent; color: var(--text-main); border: 1px solid #32383e; }
.btn--ghost:hover { background: var(--background-color-hover, #eef5fb); }

/* Estilos para a página de termos legais */
.legal-content {
    line-height: 1.6;
    padding-top: 15px;
}
.legal-content h3 {
    color: var(--primary-dark);
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #e7eef7;
    padding-bottom: 5px;
}
.legal-content h3:first-child {
    margin-top: 0;
}
.legal-content p {
    text-align: justify;
}

/* CARDS (estilo unificado) */
.cards-stats {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 15px;
  margin-bottom: 32px;
}
.card-stat {
  background: var(--card-bg);
  border-radius: var(--card-radius);
  padding: 21px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 90px;
  transition: box-shadow .17s, transform .17s, background .2s;
}
.card-stat:hover {
  box-shadow: var(--card-hover-shadow);
  transform: translateY(-2px) scale(1.025);
}
.stat-title {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 1.02em;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: .1px;
}
.stat-value {
  font-size: 1.7em;
  font-weight: 900;
  color: var(--text-strong);
  margin-bottom: 0;
}

/* Lista curta para próximos eventos/ferias em painéis */
.lista-ferias-dashboard { margin: .25rem 0 0 0; padding-left: 1.1rem; }
.lista-ferias-dashboard li { margin: .25rem 0; }

/* Ícone circular unificado para cards estatísticos (se existir) */
.card-stat .stat-icon, .stat-card-icon {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--primary); background: var(--primary-light);
  box-shadow: 0 0 0 0 rgba(0,0,0,0.0);
}

/* FORMULÁRIOS */

/* Layouts utilitários para formulários em painéis (ex.: Configurações) */
.form-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px; /* linhas x colunas */
  align-items: start;
}
.form-2col .col { display: flex; flex-direction: column; }
@media (max-width: 768px) {
  .form-2col { grid-template-columns: 1fr; gap: 14px; }
}

/* Espaçamento consistente entre grupos */
.form-group { margin-bottom: 14px; }
.form-group label { margin-bottom: 6px; font-weight: 600; }

/* Harmonizar cor dos labels no bloco SMTP com o campo de notificações */
.form-config-smtp .form-2col label,
.form-config-smtp-test .form-2col label {
  color: #b7c0cf;
  font-weight: 600;
  margin-bottom: 6px;
}

/* Ações do formulário com respiro superior */
.form-actions { margin-top: 12px; display: flex; gap: 10px; align-items: center; }

/* Painéis de formulário: mais respiro interno para inputs densos */
.form-section.panel { padding: 20px; }
.form-section.panel .panel-header { margin-bottom: 16px; }

/* Inputs e selects com altura e espaçamentos harmonizados */
.form-section input[type="text"],
.form-section input[type="email"],
.form-section input[type="password"],
.form-section input[type="number"],
.form-section select {
  height: 42px;
}

/* Emparelhar o botão "Testar Email" à direita quando usado em 2 colunas */
.form-config-smtp-test .form-2col .col:last-child { display: flex; justify-content: flex-end; }

/* Melhorar espaçamento vertical entre painéis consecutivos */
.panel + .panel { margin-top: 18px; }



.form-row {
    display: flex;
    gap: 32px;
    margin-bottom: 20px;
}
.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.form-group input,
.form-group textarea {
    width: 100%;
    min-height: 38px;
    border-radius: 8px;
    border: 1px solid #7f9cbf;
    padding: 8px 12px;
    font-size: 1em;
    font-family: inherit;
    box-sizing: border-box;
    margin-top: 2px;
}
.form-group textarea {
    resize: vertical;
    min-height: 38px;
}
.form-group label {
    color: #40bfff;
    margin-bottom: 2px;
    font-weight: 500;
}
form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="date"],
form input[type="number"],
form select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid #bed3e7;
  border-radius: 7px;
  font-size: 1rem;
  transition: border .13s;
}
form input:focus, form select:focus {
  border-color: var(--primary);
  outline: none;
}

/* Placeholders mais legíveis */
form input::placeholder, .form-section input::placeholder, .form-section select::placeholder {
  color: #9bb3c9;
  opacity: 1; /* garante a cor definida em alguns browsers */
}
button, .btn {
  background: var(--primary);
  color: var(--text-light);
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 1.04rem;
  font-weight: 700;
  box-shadow: none;
  cursor: pointer;
  transition: background .12s;
  display: inline-block;
  text-decoration: none; /* remove sublinhado em anchors com .btn */
  letter-spacing: .07px;
}
button:hover, .btn:hover {
  background: var(--primary-dark);
  color: #fff;
  box-shadow: none;
  transform: none;
  text-decoration: none; /* mantém sem sublinhado no hover */
}
/* Espaço entre ícone e texto nos botões */
.btn i { margin-right: 6px; }

/* ALERTAS */
.alerta {
  border-radius: 8px;
  padding: 10px 15px;
  margin-bottom: 15px;
  font-size: 1.03rem;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  box-shadow: 0 1px 7px #e5e5e520;
}
.alerta.sucesso {
  background: #e2f7e9;
  color: #257a4a;
  border-left: 4px solid var(--success);
}
.alerta.erro {
  background: #ffeaea;
  color: #bb4747;
  border-left: 4px solid var(--danger);
}
/* Estilos para alertas detalhados com mais conteúdo */
.alerta-detalhado {
  display: block; /* Sobrescreve o display:flex do .alerta base para conteúdo em bloco */
  margin-top: 20px;
  margin-bottom: 20px;
}

.alerta-detalhado h4 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1em; /* Um pouco maior que o texto normal do alerta */
  /* A cor será herdada de .alerta.erro ou .alerta.sucesso */
}

.alerta-detalhado h4 .fas {
  margin-right: 8px; /* Espaço entre o ícone e o texto do título */
}

.alerta-detalhado p {
  margin-bottom: 10px;
  line-height: 1.5; /* Melhora a legibilidade do parágrafo */
}

.alerta-detalhado ul {
  padding-left: 20px; /* Recuo padrão para listas */
  margin-bottom: 0; /* Remove margem inferior se for o último elemento */
  list-style-type: disc; /* Garante que os marcadores de lista sejam visíveis */
}
.alerta-detalhado li {
  margin-bottom: 5px; /* Espaçamento entre itens da lista */
  line-height: 1.4; /* Melhora a legibilidade dos itens da lista */
}
/* === Estilos para Submenu === */

/* Remove padding e marcadores da nova lista UL */
.menu-lateral ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.menu-lateral ul li {
  width: 100%;
}

/* Esconde o submenu por defeito */
.menu-lateral .submenu {
  display: none;
  background-color: rgba(0,0,0,0.15); /* Cor de fundo para destacar */
  overflow: hidden;
}

/* Mostra o submenu quando a classe 'open' está presente */
.menu-lateral .submenu.open {
  display: block;
}

/* Estilo para os links do submenu */
.menu-lateral .submenu a {
  font-size: 0.9em; /* Fonte um pouco menor */
  padding-left: 45px; /* Indentação para o texto dos sub-itens */
}

/* Adiciona uma seta para indicar um submenu */
.menu-lateral .has-submenu > a::after {
  content: '▸'; /* Seta para a direita */
  float: right;
  margin-right: 15px;
  transition: transform 0.3s ease;
}

/* Gira a seta quando o submenu está ativo/aberto */
.menu-lateral .has-submenu.active > a::after {
  transform: rotate(90deg);
}

/* ---------- TABELAS BASE ---------- */
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--card-bg, #fff);
  margin-bottom: 17px;
  border-radius: var(--card-radius, 10px); /* overflow: hidden removido para permitir que a tabela expanda */
  box-shadow: var(--card-shadow, 0 2px 12px #e1eafc33);
}
th, td {
  padding: 12px 13px;
  border-bottom: 1px solid var(--card-border, #e0ebf7);
  text-align: left;
  font-size: 1em;
  color: var(--text-main, #22324d);
  overflow-wrap: break-word; /* Permite que palavras longas nas células quebrem e previne o overflow */
}
th {
  background: var(--primary-light, #eaf2f9);
  color: var(--primary, #2274a5);
  font-size: 1.04em;
  font-weight: 700;
}
tr:last-child td {
  border-bottom: none;
}
tr:nth-child(even) td {
  background: var(--bg-table-even, #f6fafc);
  color: var(--text-main, #22324d);
}
tr:nth-child(odd) td {
  background: var(--card-bg, #fff);
}
tr:hover td {
  background: var(--primary-light, #e6f3fa);
  color: var(--primary-dark, #0c2945);
  transition: background .12s, color .12s;
}
/* RESPONSIVO */
@media (max-width: 1100px) {
  .cards-stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .menu-lateral { width: 236px; }
  .menu-lateral .txt { display: inline; }
  .dashboard-main { margin-left: 236px; padding-left: 3vw; padding-right: 3vw;}
  .container {
    padding: 10px 3vw 11px 3vw;
    overflow-x: auto; /* Adicionado para permitir scroll horizontal se o conteúdo (tabela) for largo demais */
  }
  .cards-stats { gap: 7px; }
}
@media (max-width: 650px) { /* Movido para manter a ordem de breakpoints e ajustado padding */
  .header-fixo { padding: 0 12px; font-size: .96em;}
  .dashboard-main { padding: 76px 2vw 28px 2vw;}
  .container { border-radius: 7px; padding: 4px 2vw 9px 2vw; }
  .cards-stats { grid-template-columns: 1fr; }
  .header-utilizador .user-type-label { /* Esconde o tipo de utilizador em telas menores */
    display: none;
  }
  table, th, td { font-size: .93em;}
}

/* SCROLL EM TABELA MOBILE */
@media (max-width: 520px) {
  table, thead, tbody, th, td, tr { display: block; width: 100%;}
  thead { display: none;}
  tr { margin-bottom: 12px; }
  td {
    border: none;
    position: relative;
    padding-left: 52%;
    min-height: 34px;
    font-size: .97em;
    overflow-wrap: break-word; /* Permite quebra de palavras longas no conteúdo da célula */
  }
  td:before {
    position: absolute;
    top: 8px; left: 9px; width: 46%; 
    white-space: normal; /* Permite quebra de linha nos rótulos */
    font-weight: bold;
    color: var(--primary-dark);
    content: attr(data-label);
    font-size: .97em;
  }
  .container {
    overflow-x: initial; /* Reseta o overflow-x quando a tabela empilha, pois não deve haver scroll horizontal do container */
  }
}

@media (max-width: 430px) { /* Mantido para overrides específicos de 430px */
  .header-fixo { height: 48px; font-size: .90em; }
  .dashboard-main { padding-top: 58px;}
   .header-logo img { /* Ajusta a altura do logo para caber no header reduzido */
    height: 30px; 
  }
  .container { border-radius: 4px; padding: 2px 2vw 5px 2vw; }
}

/* DARK MODE */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-main: #1a1d21;
    --bg-card: #1a1d21;
    --primary: #3577f1;
    --primary-dark: #2f6fdc;
    --primary-light: #283142;
    --text-main: #ced4da;
    --text-light: #fff;
    --success: #0ab39c;
    --danger: #ef7070;
    --bg-table-even: #212b3a;

    /* Tokens de cartão (dark) */
    --card-bg: #1a1d21;
    --card-border: #32383e;
    --card-shadow: 0 6px 24px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
    --card-hover-shadow: 0 10px 30px rgba(0,0,0,0.35);
    --text-strong: #ffffff;
    --text-secondary: #878a99;

        /* Variáveis para .form-page-form inputs (Dark Mode Overrides) */
    --form-page-input-bg: #223049;
    --form-page-input-text: #eaf6fe;
    --form-page-input-border: #354f70; /* Consistente com outros inputs escuros */
    --form-page-input-focus-bg: #1f2a3b;
    --form-page-input-focus-border: var(--primary); /* var(--primary) já é temático para escuro aqui */
    --form-page-input-disabled-bg: #283448;
    --form-page-input-disabled-text: #8190a0;
    --form-page-input-disabled-border: #354f70;
  }
  body { background: var(--bg-main); color: var(--text-main);}
  .header-fixo { background: #212529; color: var(--text-light);}
  .header-topbar-main { background: #212529; }
  .menu-lateral { background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%); border-right-color: var(--sidebar-border);}
  .menu-lateral a { color: var(--sidebar-item); }
  .menu-lateral a.active, .menu-lateral a:hover { background: rgba(255,255,255,0.045); color: var(--sidebar-item-hover); border-color: transparent;}
  .menu-lateral a.active { background: rgba(255,255,255,0.05); color: var(--sidebar-item-active); border-color: rgba(255,255,255,0.06);}
  .dashboard-main { background: var(--bg-main);}
  .container { background: var(--bg-card); color: var(--text-main);}
  .legal-content h3 {
    color: var(--primary); /* Cor primária mais clara do dark mode */
    border-bottom-color: #27354c; /* Cor de borda escura consistente com o menu */
  }

  .card-stat {
    background: var(--card-bg);
    color: #d7e9fa;
  }
  .stat-title { color: #cfe6ff; }
  .stat-value { color: #ffffff; }
  th { background: #273142; color: #9fb0c8;}
  tr:nth-child(even) td { background: var(--bg-table-even);}
  .alerta.sucesso { background: #243c2a; color: #7fffa8; border-left-color: var(--success);}
  .alerta.erro { background: #533232; color: #ffd7d7; border-left-color: var(--danger);}
  input, select { background: #1b2533; color: #ced4da; border-color: #2b3b50; }
  input::placeholder, .form-section input::placeholder, .form-section select::placeholder { color: #7f8a9b; opacity: 1; }
}

/* Força tokens quando .dark-mode é aplicado manualmente no <body> */
body.dark-mode {
  --bg-main: #1a1d21;
  --bg-card: #1a1d21;
  --text-main: #ced4da;
  --card-bg: #1a1d21;
  --card-border: #32383e;
  --card-shadow: 0 6px 24px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.05);
  --card-hover-shadow: 0 10px 30px rgba(0,0,0,0.35);
  --text-strong: #ffffff;
  --text-secondary: #878a99;
}
.filtro-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 400px;
  margin-bottom: 28px;
}
.filtro-form label {
  margin-bottom: 4px;
  font-weight: 600;
  color: #94a3b8;
  display: block;
  user-select: none; -webkit-user-select: none; -ms-user-select: none; cursor: default;
}
.filtro-form input[type="date"],
.filtro-form input[type="text"],
.filtro-form select {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid #bed3e7;
  border-radius: 7px;
  font-size: 1rem;
  background-color: #FFFFFF; /* Fundo branco explícito para tema claro */
  color: #22324d; /* Cor de texto escura explícita para tema claro */
  transition: border .13s, background .13s;
  height: 42px;
  box-sizing: border-box;
}

.filtro-form .btn,
.filtro-form button[type="submit"] {
  height: 42px;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 1.05rem;
}

 @media (prefers-color-scheme: dark) {
  .login-user-list h2 {
    color: #5cd8ff;
    font-weight: 900;
    font-size: 2em;
    letter-spacing: .01em;
    text-shadow: 0 2px 13px #145d857c;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  }

  .utilizador-nome {
    color: #6feaff;
    font-weight: 900;
    font-size: 1.19em;
    letter-spacing: 0.02em;
    line-height: 1.16;
    text-shadow: 0 3px 18px #19c8ff36, 0 1.5px 7px #132e463a;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  }

  .utilizador-tipo {
    color: #bbecff;
    font-weight: 500;
    font-size: 1em;
    opacity: 1;
    letter-spacing: .01em;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
    text-shadow: 0 2px 10px #25b4ff16;
  }

  .utilizador-card input,
  .utilizador-card input::placeholder {
    color: #9ddaff !important;
    opacity: 1;
    font-size: 1em;
    font-weight: 400;
    letter-spacing: .01em;
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  }
}

.utilizador-card:hover {
  animation: userCardPulse 0.24s;
}
@keyframes userCardPulse {
  0%   { transform: scale(1.0);}
  55%  { transform: scale(1.055);}
  100% { transform: scale(1.045);}
}


@media (min-width: 700px) {
  .filtro-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: end;
    gap: 22px;  /* aumenta o gap para desktop */
    max-width: none;
  }
  .filtro-form > div {
    min-width: 150px;
    flex: 1 1 150px;
  }
}

  .filtro-form .btn,
  .filtro-form a.btn {
    width: auto;
    min-width: 110px;
    margin-top: 0;
  }

/* Modo escuro */
@media (prefers-color-scheme: dark) {
  .filtro-form input[type="date"],
  .filtro-form select {
    background: #1b2533 ;
    color: #ced4da ;
    border: 1px solid #2b3b50;
  }
  .filtro-form label {
    color: #94a3b8 ;
  }
  .filtro-form .btn {
   background: var(--primary); /* Usa a variável para consistência */
    color: var(--text-light);
  }
  .filtro-form a.btn {
    background: #1b2533;
    color: #94a3b8;
    border: 1px solid var(--primary); /* Usa a variável para consistência */
  }
   /* Estilo para as opções do select no modo escuro para garantir visibilidade e consistência */
  .filtro-form select option {
   background: #1b2533 !important;
    color: #ced4da !important;
  }


}

/* ---------- DARK MODE PARA TABELAS ---------- */
@media (prefers-color-scheme: dark) {

  table {
    background: var(--card-bg, #233049);
    color: var(--text-main, #eaf6fe);
    box-shadow: var(--card-shadow, 0 2px 12px rgba(0,0,0,0.2));
  }
  th {
    background: var(--primary-light, #1b2739);
    color: var(--primary, #7fd6f8);
  }
  tr:nth-child(even) td {
    background: var(--bg-table-even, #20283c);
    color: var(--text-main, #eaf6fe);
  }
  tr:nth-child(odd) td {
    background: var(--card-bg, #233049);
    color: var(--text-main, #eaf6fe);
  }
  tr:hover td {
    background: var(--primary-light, #2c4267);
    color: var(--primary, #7fd6f8);
  }
  td, th {
    border-bottom: 1px solid var(--card-border, #304259);
  }
}
input, select, textarea {
  background: #f9fbfd;
  color: #22324d;
  border: 1px solid #bed3e7;
}
input:disabled, select:disabled, textarea:disabled {
  background: #e9ecef ;
  color: #bcc3ce ;
  opacity: 1 ;
}

/* Autofill Chrome/Safari */
input:-webkit-autofill,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #f9fbfd inset !important;
  -webkit-text-fill-color: #22324d !important;
  box-shadow: 0 0 0 30px #f9fbfd inset !important;
  color: #22324d !important;
}
@media (prefers-color-scheme: dark) {
  input, select, textarea {
    background: #262a2f;
    color: #eaf6fe;
    border: 1px solid #355884;
  }
  input:disabled, select:disabled, textarea:disabled {
    background: #283040 ;
    color: #79889a ;
    opacity: 1;
  }
  /* Autofill dark mode */
  input:-webkit-autofill,
  input:-webkit-autofill:focus,
  input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #262a2f inset !important;
    -webkit-text-fill-color: #eaf6fe !important;
    box-shadow: 0 0 0 30px #262a2f inset !important;
    color: #eaf6fe !important;
  }

  /* Select dropdown: garantir fundo escuro nas opções */
  select { color-scheme: dark; }
  select option, select optgroup { background-color: #283040; color: #eaf6fe; }
  select option:checked, select option:hover { background-color: #355884; color: #eaf6fe; }
}

/* Regras equivalentes quando o modo escuro é forçado por classe */
body.dark-mode select { background: #262a2f; color: #eaf6fe; border: 1px solid #355884; color-scheme: dark; }
body.dark-mode select option, body.dark-mode select optgroup { background-color: #283040; color: #eaf6fe; }
body.dark-mode select option:checked, body.dark-mode select option:hover { background-color: #355884; color: #eaf6fe; }
/* ---------- FORMULÁRIO IGUAL AO CONTAINER DE ENTRADAS/SAÍDAS ---------- */
.form-page-container {
  background: var(--bg-card, #262a2f);
  border-radius: 13px;
  box-shadow: 0 2px 18px 0 rgba(40,110,180,0.12), 0 2px 8px 0 rgba(22,35,60,0.09);
  padding: 38px 32px 34px 32px;
  margin-bottom: 40px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid #5faee3;
  color: var(--text-main, #eaf6fe);
  position: relative;
  width: 100%;
}

.form-page-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-size: 1.10rem;
}

.form-page-form label {
  font-weight: 600;
  color: var(--primary, #2fc9ff);
  margin-bottom: 4px;
  font-size: 1.09em;
  display: block;
}

.form-page-form input[type="text"],
.form-page-form input[type="email"],
.form-page-form input[type="password"],
.form-page-form select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 8px;
  font-size: 1.11rem;
  transition: border .13s, background .13s;
  outline: none;
   background: var(--form-page-input-bg);
  color: var(--form-page-input-text);
  border: 1.4px solid var(--form-page-input-border);
}

.form-page-form input:focus,
.form-page-form select:focus {
  border-color: var(--form-page-input-focus-border);
  background: var(--form-page-input-focus-bg);
}

.form-page-form input:disabled, .form-page-form select:disabled {
  opacity: 1;
  background: var(--form-page-input-disabled-bg);
  border-color: var(--form-page-input-disabled-border);
  color: var(--form-page-input-disabled-text);

}

.form-page-form .btn, .form-page-form button[type="submit"] {
  background: linear-gradient(90deg, #2ca1dd 60%, #00c8ff 100%);
  color: #fff;
  padding: 13px 0;
  border: none;
  border-radius: 8px;
  font-size: 1.14rem;
  font-weight: 800;
  box-shadow: 0 2px 12px rgba(34,116,165,0.13);
  cursor: pointer;
  transition: background .14s, box-shadow .13s, transform .13s;
  width: 100%;
  margin-top: 8px;
  letter-spacing: .15px;
}
.form-page-form .btn:hover, .form-page-form button[type="submit"]:hover {
  background: linear-gradient(90deg, #00c8ff 60%, #2ca1dd 100%);
  box-shadow: 0 8px 24px rgba(40,170,220,0.16);
  transform: translateY(-1px) scale(1.012);
}

/* Placeholder legível */
.form-page-form input::placeholder {
  color: #a5b9ce;
  opacity: 1;
  font-size: 1.04em;
}

/* Responsive */
@media (max-width: 900px) {
  .form-page-container {
    padding: 22px 4vw 18px 4vw;
    max-width: 99vw;
    border-radius: 9px;
  }
  .form-page-form input, .form-page-form select {
    font-size: 1rem;
    padding: 10px 7px;
    border-radius: 7px;
  }
  .form-page-form .btn {
    padding: 11px 0;
    font-size: 1rem;
    border-radius: 7px;
  }
  .form-page-form {
    gap: 14px;
    font-size: .98rem;
  }
}


.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 24px;
  align-items: start;
}

.form-2col .col {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-2col .col-full {
  grid-column: 1 / 3;
  margin-top: 14px;
}

.form-2col label {
  font-weight: 700;
  color: #33c6fe;
  margin-bottom: 2px;
  font-size: 1.12em;
  letter-spacing: 0.02em;
}

.form-2col input,
.form-2col select {
  width: 100%;
  box-sizing: border-box;
  /* nada de margin lateral aqui */
}

.form-2col input:focus,
.form-2col select:focus {
  border-color: #2fc9ff;
}

/* Botão ocupa duas colunas */
.form-2col .btn {
  width: 100%;
  font-size: 1.08em;
  padding: 15px 0;
  border-radius: 8px;
  margin-top: 0;
  font-weight: 800;
}


/* Responsive para mobile/tablet */
@media (max-width: 800px) {
  .form-2col {
    grid-template-columns: 1fr;
    gap: 16px 0;
  }
  .form-2col .col-full {
    grid-column: auto;
    margin-top: 10px;
  }
  .form-2col .btn {
    font-size: 1em;
    padding: 13px 0;
    border-radius: 7px;
  }
  .form-2col label {
    font-size: 1em;
  }
  .form-2col input, .form-2col select {
    font-size: 1em;
    padding: 11px 8px;
    border-radius: 7px;
  }
}
/* Container do alerta */
.container-alerta {
  background: rgba(35, 48, 73, 0.92);   /* Igual ao .container do dashboard */
  box-shadow: 0 6px 40px 0 rgba(40,110,180,0.13), 0 2px 8px 0 rgba(22,35,60,0.11);
  padding: 38px 32px 34px 32px;
  margin-bottom: 48px;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  border: 1.5px solid #ff4c4c;         /* Mantém vermelho para destaque */
  color: #ff3737;
  position: relative;
  /* Glass */
  backdrop-filter: blur(7px) saturate(1.4);
  -webkit-backdrop-filter: blur(7px) saturate(1.4);
  transition: box-shadow .22s, background .22s;
}


.container-alerta h3 {
  color: #ff4c4c;
  font-weight: 800;
  margin-top: 0;
}

.container-alerta ul {
  margin-top: 19px;
}

.container-alerta ul li {
  color: #ff2d2d;
  font-weight: 700;
  margin-bottom: 11px;
  letter-spacing: 0.02em;
  font-size: 1.09em;
  list-style: disc inside;
}

.login-numerico-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 32px 24px 32px;
  justify-content: center;
}

.login-numerico-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  margin-top: 20px;
  width: 100%;
  min-height: 110px;
}

.login-numerico-header .avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: #cfd6de;
  border: 3.5px solid #23c0f7;
  box-shadow: 0 2px 14px #343e5015;
  margin-bottom: 9px;
}

.login-numerico-header .nome-utilizador {
  font-weight: 900;
  color: #23c0f7;
  font-size: 1.25em;
  letter-spacing: 0.02em;
  text-align: center;
  text-shadow: 0 2px 10px #0af6ff12;
  margin-top: 0;
}

.pin-input {
  width: 100%;
  font-size: 1.55em;
  padding: 12px 14px;
  border: 1.5px solid #77c8ee;
  border-radius: 11px;
  color: #3ac2ff;
  text-align: center;
  outline: none;
  margin-bottom: 22px;
  margin-top: 2px;
  box-sizing: border-box;
  letter-spacing: 0.24em;
  font-weight: 700;
  transition: box-shadow .16s;
  box-shadow: 0 3px 18px #39bbf227;
}

.pin-input:focus {
  border-color: #3ac2ff;
  box-shadow: 0 4px 16px #3ac2ff22;
}

.login-numerico-container .login-pin-feedback {
  width: 100%;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #2b2325;
  color: #ff9f9f;
  font-size: 0.94rem;
  font-weight: 600;
  text-align: center;
  transform: translateY(-4px);
  transition: max-height 0.22s ease, opacity 0.22s ease, margin 0.22s ease, padding 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.login-numerico-container .login-pin-feedback:empty {
  pointer-events: none;
}

.login-numerico-container .login-pin-feedback.is-visible {
  width: 100%;
  margin: -8px 0 16px 0;
  padding: 10px 12px;
  border: 1px solid #b94a48;
  max-height: 64px;
  opacity: 1;
  transform: translateY(0);
}

.teclado-numerico {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
  margin-bottom: 22px;
}

.teclado-btn {
  background: linear-gradient(90deg, #28b6f6 60%, #20c3ee 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.36em;
  font-weight: 900;
  box-shadow: 0 2.5px 9px #1e7ca62a, 0 1.2px 2px #0b203515;
  padding: 18px 0 14px 0;
  transition: background 0.13s, box-shadow 0.17s, color 0.11s;
  cursor: pointer;
  outline: none;
  user-select: none;
}
.teclado-btn:hover,
.teclado-btn:active,
.teclado-btn:focus {
  background: linear-gradient(90deg, #2293d4 55%, #1ba9c7 100%);
  color: #fff;
  box-shadow: 0 3px 14px #2293d455, 0 1.5px 2px #0b203512;
}

.btn-row {
  display: flex;
  gap: 22px;
  width: 100%;
  margin-bottom: 9px;
}

.btn-confirm,
.btn-cancel {
  flex: 1;
  font-size: 2.2em;
  padding: 10px 0 7px 0;
  border-radius: 11px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.13s, box-shadow 0.13s;
  box-shadow: 0 2px 12px #189d4362, 0 1px 2px #0002;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-confirm {
  background: linear-gradient(90deg, #3ef189, #2edeb2 96%);
  color: #fff;
}
.btn-cancel {
  background: linear-gradient(90deg, #f24444, #da3d5e 98%);
  color: #fff;
}
.btn-confirm:hover { background: #19a453; }
.btn-cancel:hover { background: #be285c; }

@media (max-width: 600px) {
  .login-numerico-container {
    max-width: 98vw;
    min-width: unset;
    padding: 7vw 2vw 10vw 2vw;
  }
  .pin-input { font-size: 1.18em; }
  .teclado-btn { font-size: 1em; padding: 11px 0 10px 0;}
  .btn-confirm, .btn-cancel { font-size: 1.3em;}
}
.login-user-list {
  background: linear-gradient(135deg, #262f3d 80%, #223242 100%);
  border-radius: 16px;
  box-shadow: 0 8px 42px #1820402a;
  margin: 54px auto 0 auto;
  padding: 38px 24px 36px 24px;
  border: 1.4px solid #b6ecff29;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-user-list h2 {
  font-size: 2em;
  color: #23c0f7;
  font-weight: 900;
  margin-bottom: 35px;
  text-align: center;
  letter-spacing: 0.01em;
  text-shadow: 0 3px 18px #24c0ff1a;
}

.utilizadores-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 38px;
  width: 100%;
  margin-bottom: 20px;
}

.utilizador-card .avatar {
  width: 66px; height: 66px;
  border-radius: 50%;
  background: #f3fbff;
  border: 3.5px solid #23c0f7;
  margin-top: 20px; /* Adicionado para criar espaço para a etiqueta da reparação */
  margin-bottom: 16px;
  box-shadow: 0 3px 15px #23c0f733;
}

.utilizador-nome {
  font-weight: 900;
  color: #23c0f7;
  font-size: 1.18em;
  margin-bottom: 0;
  letter-spacing: 0.02em;
  text-shadow: 0 3px 8px #24c0ff15;
}
.utilizador-tipo {
  color: #d1e9f9;
  font-size: 1.01em;
  font-weight: 500;
  margin-top: 1px;
  opacity: .92;
}

@media (max-width: 650px) {
  .login-user-list { max-width: 99vw; padding: 6vw 2vw 8vw 2vw;}
  .utilizadores-grid { gap: 21px;}
  .utilizador-card { min-width: 40vw; padding: 5vw 2vw 2vw 2vw; }
  .utilizador-card .avatar { width: 16vw; height: 16vw; min-width:44px; min-height:44px; }
}
.login-header {
  text-align: center;
  margin: 42px auto 0 auto;
  padding-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInDown 1.1s cubic-bezier(.42,1.4,.44,.96);
}

.empresa-logo {
  width: 250px;
  height: 96px;
  object-fit: contain;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 18px #1caaff1b);
  transition: transform .19s cubic-bezier(.4,1.6,.55,.9);
}
.empresa-logo:hover {
  transform: scale(1.07) rotate(-2deg);
}

.programa-nome {
  font-size: 2.1em;
  font-weight: 900;
  color: #2fd2ff;
  letter-spacing: .01em;
  margin-bottom: 7px;
  text-shadow: 0 3px 20px #15a7e830, 0 1px 0px #fff3;
  font-family: 'Segoe UI', 'Arial', sans-serif;
  animation: fadeIn .8s .12s backwards;
}

/* Pequena animação premium */
@keyframes fadeInDown {
  0% { opacity: 0; transform: translateY(-38px);}
  100% { opacity: 1; transform: none;}
}
@keyframes fadeIn {
  from { opacity: 0;}
  to { opacity: 1;}
}

@media (max-width: 600px) {
  .empresa-logo { width: 150px; height: auto; }
  .programa-nome { font-size: 1.35em;}
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #cfd6de;
  border: 2.5px solid #e4e9f7;
  object-fit: cover;
  box-shadow: 0 2px 14px #343e5022;
}
.tipo-utilizador {
  color: #7ee5fd;
  font-size: 1.05em;
  margin-top: 2px;
  text-align: center;
  font-weight: 400;
  letter-spacing: .01em;
}
.btn-editar, .btn-apagar {
  display: inline-block;
  border: none;
  border-radius: 5px;
  padding: 6px 18px;
  font-size: 1em;
  font-weight: 600;
  margin-right: 7px;
  margin-bottom: 2px;
  cursor: pointer;
  transition: background .13s;
  text-decoration: none;
}

.btn-editar {
  background: #2196f3;
  color: #fff;
}
.btn-editar:hover {
  background: #37dcff;
}

.btn-demitir {
  background: #ff9f43;
  color: #fff;
  border-radius: 5px;
  padding: 6px 18px;
  font-size: 1em;
  font-weight: 600;
  margin-left: 4px;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.btn-demitir:hover {
  background: #ff6300;
  color: #fff;
}
.btn-readmitir {
  background: var(--warning);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 6px 18px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s;
}
.desativado {
  color: #999;
  font-size: 1em;
  font-weight: 500;
  margin-left: 10px;
}

.registo-main {
    max-width: 1100px;
    margin: 32px auto 0 auto;
    padding: 30px 32px;
    background: #232b34;
    border-radius: 16px;
    box-shadow: 0 6px 32px #0008;
}

.registo-title {
    font-size: 2.1rem;
    color: #3dc6ff;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: 1px;
}

.registo-btns {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}
.registo-btn {
    padding: 20px 0;
    font-size: 1.4rem;
    font-weight: bold;
    border-radius: 12px;
    border: none;
    transition: background .14s, box-shadow .14s;
    cursor: pointer;
    box-shadow: 0 2px 10px #202b3c22;
}
.registo-btn.entrada, .registo-btn.pausa-inicio, .registo-btn.pausa-fim {
    background: linear-gradient(90deg, #3dc6ff 70%, #30baff 100%);
    color: #fff;
}
.registo-btn.entrada:hover,
.registo-btn.pausa-inicio:hover,
.registo-btn.pausa-fim:hover {
    filter: brightness(1.15);
    box-shadow: 0 4px 24px #3dc6ff33;
}
.registo-btn.saida {
    background: linear-gradient(90deg, #fa5050 60%, #ff8181 100%);
    color: #fff;
}
.registo-btn.saida:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 24px #fa505055;
}

.registo-sep {
    height: 1px;
    background: #353f4c;
    margin: 30px 0 18px 0;
    border-radius: 2px;
}

.registos-titulo {
    font-size: 1.3rem;
    color: #3dc6ff;
    font-weight: 700;
    margin-bottom: 10px;
}

.registo-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--card-radius, 10px);
    overflow: hidden;
    background: var(--card-bg);
}
.registo-table th, .registo-table td {
    padding: 13px 16px;
    text-align: left;
}
.registo-table th {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
}
.registo-table tr {
    background: var(--card-bg);
}
.registo-table tr:nth-child(even) {
    background: var(--bg-table-even);
}
.registo-ponto-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}



.registo-ponto-form .btn-block {
    width: 100%;
    padding: 30px 0;
    font-size: 1.2rem;
    min-width: 0;
    border-radius: 12px;
    font-weight: 600;
    color: #fff;
    border: none;
    transition: background 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px 0 rgba(0,0,0,0.10);
    cursor: pointer;
    outline: none;
}

.registo-ponto-form .btn-block:active {
    transform: scale(0.98);
}

.registo-ponto-form .btn-block:hover,
.registo-ponto-form .btn-block:focus {
    background: linear-gradient(90deg, #2e90c6 70%, #1b6e97 100%);
    box-shadow: 0 4px 20px #38b6ff88;
}


@media (max-width: 900px) {
  .registo-ponto-form {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 500px) {
  .dashboard-main { padding: 70px 3vw 20px 3vw; }
  .container { padding: 7px 3vw 7px 3vw; }
  .card-stat, .cards-stats { padding: 9px; }
  .registo-table th, .registo-table td { padding: 7px 5px; font-size: 0.96em; }
  .registo-table th, .registo-table td {
    white-space: nowrap;
  }
}



.registo-ponto-form .btn-entrada { background: #29c4f0; color: #fff; }
.registo-ponto-form .btn-saida { background: #e84545; color:#fff; }
.registo-ponto-form .btn-pausa { background: #ffd600; color: #fff; }



.tabela-registos th, .tabela-registos td {
    text-align: center;
    font-size: 1.07em;
    padding: 14px 10px;
    border-bottom: 1px solid var(--card-border);
}
.tabela-registos th {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
}
/*.tabela-registos tr:nth-child(even) td {
    background: #233047;
}*/
.tabela-registos tr {
    background: var(--card-bg);
}
.tabela-registos tr:nth-child(even) td { background: var(--bg-table-even); }
.tabela-registos tr:hover td {
    background: var(--primary-light);
    color: var(--text-strong);
    transition: .18s;
}
.tipo-entrada { color: #29c4f0; font-weight: bold; }
.tipo-saida { color: #e84545; font-weight: bold; }
.tipo-pausa { color: #ffd600; font-weight: bold; }
.sucesso { background: #c5f7d3; color: #198754; border-radius: 8px; padding: 10px; margin: 10px 0; }
.nenhum-registo { color: #ccc; text-align: center; margin-top: 20px; }


.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.page-title { font-size: 2em; margin-bottom: 15px; }
    .success-message { color: #27e227; font-weight: 500; margin-bottom: 15px;}
    .reparacao-form, .form-row { display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap;}
    .reparacao-form input { width: 220px; }
    .btn { padding: 12px 30px; font-size: 1em; border-radius: 7px; border: 0; cursor: pointer; }
    .btn.iniciar { background: #29c4f0; color: #fff;}
    .btn.terminar { background: linear-gradient(90deg,#d93e3e 70%,#ff6363 100%); color: #fff;}
    .btn.pausar { background: #ffe082; color: #252a36;}
    .btn.retomar { background: #6ee780; color: #151d14;}
    table { width: 100%; border-radius: 10px; background: #202a39; color: #e6f1fa; border-collapse: collapse; margin-top:12px;}
    th, td { padding: 10px 7px; text-align: center; }
    th { background: #253044; color: #5ad6ff; font-weight: 600;}
    tbody tr:nth-child(even) { background:#222e40;}
    .cronometro { font-family: 'Inter', monospace; font-size: 1.2em; font-weight: 700; color: #5ad6ff; }
    .cronometro.cronometro-pausado { color: #a5b0c2; }
    .estado-pausa { color: #e84545; font-weight: bold; }
    .records-page .records-table .rep-actions-inline {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .records-page .records-table .rep-actions-inline .btn {
      min-height: 34px;
      padding: 0 12px;
      border-radius: 8px;
      font-size: 0.9rem;
    }
    .records-page .records-table .rep-state-note {
      margin-top: 4px;
      font-size: 0.8rem;
      color: #9aa4b2;
    }
    .records-page .records-table .rep-timer-note {
      margin-top: 4px;
      font-size: 0.8rem;
      color: #f1b44c;
    }
    @media (max-width:800px) {
      .reparacao-form input { width: 100%; }
      th, td { padding:7px 4px;}
    }

.paginacao-container .btn {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid #323b45;
  background: #212529;
  color: #878A99;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
  margin: 0;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
  box-shadow: none;
  cursor: pointer;
}
.paginacao-container .btn.active,
.paginacao-container .btn:active {
  background: #556ee6;
  border-color: #556ee6;
  color: #ffffff;
  box-shadow: none;
  cursor: default;
}
.paginacao-container .btn:hover:not(.active) {
  background: #262d36;
  border-color: #3a4552;
  color: #d7dee8;
}
@media (min-width: 1280px) {
  .container { max-width: 1480px; }
}
@media (max-width: 450px) {
  html, body {
    font-size: 14px ;
  }
  .header-fixo {
    height: 46px ;
    padding: 0 5px ;
    font-size: 0.94em;
  }
  .header-logo img { /* Ajuste fino para o logo no breakpoint de 450px, se necessário */
    font-size: 0.94em;
}

  .menu-lateral {
    width: 45px ;
    min-width: 45px ;
  }
  .dashboard-main {
    margin-left: 0 ;
    padding: 52px 2vw 16px 2vw ;
  }
  .container, .form-page-container {
    padding: 9px 1vw 9px 1vw ;
    max-width: 99vw ;
    border-radius: 6px ;
    box-shadow: 0 2px 12px #202a39bb;
  }
  h2, h3, .page-title, .registo-title {
    font-size: 1.12em ;
    margin-bottom: 11px ;
  }
  .cards-stats {
    grid-template-columns: 1fr ;
    gap: 7px ;
  }
  /* Formulários */
  .form-row, .reparacao-form {
    flex-direction: column ;
    gap: 7px ;
  }
  .form-group input, .form-group textarea, .form-page-form input, .form-page-form select {
    font-size: 1em ;
    padding: 8px 7px ;
    border-radius: 6px ;
    min-width: 0 ;
  }
  .registo-ponto-form {
    grid-template-columns: 1fr;
    gap: 12px ;
  }
  .registo-ponto-form .btn-block,
  button, .btn {
    font-size: 1em ;
    padding: 16px 0 ;
    border-radius: 7px ;
  }
  .tabela-registos, table, .registo-table {
    font-size: 0.95em ;
    border-radius: 6px ;
    min-width: 0 ;
  }
  th { /* Aplicar padding geral aos cabeçalhos */
    padding: 8px 2px;
    font-size: 1em ;
  }
  td { /* Para as células de dados, apenas ajustar o font-size se necessário, preservando o padding-left da regra de 520px para empilhamento */
    font-size: 1em;
  }
  /* Tabelas em stack (scroll horizontal se necessário) */
  .container, .form-page-container {
    overflow-x: auto ;
  }
  /* Login PIN */
  .login-numerico-container {
    padding: 6vw 1vw 8vw 1vw ;
    max-width: 98vw ;
  }
  .pin-input {
    font-size: 1.05em ;
    padding: 8px 7px ;
  }
  .teclado-btn {
    font-size: 0.93em ;
    padding: 10px 0 ;
    border-radius: 8px ;
  }
  .utilizadores-grid {
    gap: 11px ;
  }
  .utilizador-card {
    min-width: 74vw ;
    max-width: 98vw ;
    padding: 7vw 2vw 2vw 2vw ;
  }
   /* Ajustes para paginação em telas muito pequenas */
  .paginacao-container {
    gap: 4px; /* Reduz o espaçamento entre os botões */
  }
  .paginacao-container .btn {
    padding: 5px 10px; /* Reduz o padding dos botões */
    font-size: 0.9em; /* Reduz o tamanho da fonte dos botões */
  }
}
.menu-quick-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
}
.menu-quick-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #2a3038;
  border: 1px solid #32383e;
  color: #7f8898;
  text-decoration: none;
  transition: background .14s, color .14s, border-color .14s;
}
.menu-lateral .menu-quick-link {
  padding: 0;
  border-left: none;
  border-radius: 8px;
}
.menu-quick-link:hover {
  background: #303741;
  border-color: #3a424d;
  color: #aab2c0;
  transform: none;
  box-shadow: none;
}
.menu-quick-link .fa,
.menu-quick-link .fas,
.menu-quick-link .far,
.menu-quick-link .fa-solid,
.menu-quick-link .fa-regular {
  font-size: 1.05rem;
}

.menu-bottom-brand {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 0 12px 0;
  width: 100%;
  border-top: 1px solid #32383e;
  font-family: 'Public Sans', 'Poppins', Arial, sans-serif;
}
.menu-app-name {
  margin-top: 0;
  font-size: 1.5em;
  font-weight: 800;
  letter-spacing: 0.015em;
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
  color: transparent;
  background: linear-gradient(180deg, #6ad7ff 0%, #2ea9e7 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.menu-app-plus {
  color: #ffd12a;
  font-size: 1em;
  margin-left: 2px;
  font-weight: 900;
  text-shadow: 0 0 8px rgba(255, 209, 42, 0.28);
}
@media (prefers-color-scheme: dark) {
  .menu-bottom-brand { border-top: 1px solid #32383e; }
  .menu-app-name {
    color: transparent;
    background: linear-gradient(180deg, #6ad7ff 0%, #2ea9e7 100%);
    -webkit-background-clip: text;
    background-clip: text;
  }
  .menu-app-plus { color: #ffd600; }
  .menu-quick-link {
    background: #2a3038;
    border-color: #32383e;
    color: #7f8898;
  }
  .menu-quick-link:hover {
    background: #303741;
    border-color: #3a424d;
    color: #aab2c0;
    box-shadow: none;
  }
  
}

/* === Estilos para o Modal de Termos Legais === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 16, 0.78);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}

.modal-termos {
  background: #212529;
  color: #ced4da;
  border-radius: 8px;
  border: 1px solid #32383e;
  width: min(1120px, 100%);
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: none;
}

.modal-termos-header {
  padding: 14px 18px;
  border-bottom: 1px dashed #2a3038;
  font-size: 1.45rem;
  font-weight: 700;
  color: #e2e8f0;
}

.modal-termos-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-termos-body > p {
  margin: 0 0 12px 0;
  color: #b7c1cf;
  font-size: 1.02rem;
}

.modal-termos-body .legal-doc-block {
  margin-top: 14px;
  padding: 14px;
  background: #1f242b;
  border: 1px solid #2a3038;
  border-radius: 6px;
}

.modal-termos-body .legal-doc-block h2 {
  margin: 0 0 10px 0;
  font-size: 1.32rem;
  color: #e2e8f0;
  font-weight: 700;
}

.modal-termos-body .legal-doc-block h3 {
  margin: 14px 0 8px 0;
  color: #aab4c4;
  font-size: 1.06rem;
  font-weight: 700;
  border-bottom: 1px solid #2a3038;
  padding-bottom: 6px;
}

.modal-termos-body .legal-doc-block p,
.modal-termos-body .legal-doc-block li {
  color: #ced4da;
  line-height: 1.55;
}

.modal-termos-body .legal-doc-block p {
  margin: 0 0 10px 0;
  text-align: left;
}

.modal-termos-body .legal-doc-block ul,
.modal-termos-body .legal-doc-block ol {
  margin: 0 0 10px 18px;
  padding: 0;
}

.modal-termos-body .legal-doc-divider {
  margin: 14px 0 0 0;
  border: 0;
  border-top: 1px dashed #2a3038;
}

.modal-termos-footer {
  padding: 14px 18px;
  border-top: 1px solid #2a3038;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1f242b;
  gap: 12px;
}

.modal-termos-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-termos-footer .checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-termos-footer .checkbox-container input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.modal-termos-footer .checkbox-container label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ced4da;
  cursor: pointer;
}

.modal-termos-footer .btn {
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid #556ee6;
  background: #556ee6;
  color: #ffffff;
  font-weight: 700;
  box-shadow: none;
}

.modal-termos-footer .btn:hover {
  filter: brightness(1.06);
  box-shadow: none;
  transform: none;
}

.modal-termos-footer .btn.btn--secondary {
  border: 1px solid #3a4552;
  background: #2a3038;
  color: #ced4da;
}

.modal-termos-footer .btn.btn--secondary:hover {
  background: #303741;
  border-color: #4a5666;
  color: #e2e8f0;
  filter: none;
}

.modal-termos-footer .btn[disabled] {
  background: #3a424d;
  border-color: #3a424d;
  color: #8f98a6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === Modal de Confirmação (ações críticas) === */
.confirm-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(3, 8, 17, 0.66);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.confirm-modal-overlay[hidden] {
  display: none !important;
}

.confirm-modal {
  width: min(560px, 100%);
  background: #212529;
  border: 1px solid #32383e;
  border-radius: 8px;
  box-shadow: none;
  padding: 22px;
}

.confirm-modal__head {
  color: #e2e8f0;
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.2;
}

.confirm-modal__body {
  color: #ced4da;
  line-height: 1.45;
  margin-bottom: 0;
  font-size: 1.02rem;
}

.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #32383e;
}

.confirm-modal__actions .btn {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 700;
  box-shadow: none;
  transform: none;
}

.confirm-modal__btn-ok {
  min-width: 100px;
  border: 1px solid #556ee6;
  background: #556ee6;
  color: #ffffff;
}

.confirm-modal__btn-cancel {
  min-width: 100px;
  border: 1px solid #556073;
  background: #556073;
  color: #ffffff;
}

.confirm-modal__btn-cancel:hover {
  background: #4a5465;
  border-color: #4a5465;
  color: #ffffff;
}

@media (max-width: 760px) {
  .modal-overlay {
    padding: 10px;
  }

  .modal-termos {
    max-height: calc(100vh - 20px);
  }

  .modal-termos-header {
    font-size: 1.2rem;
  }

  .modal-termos-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-termos-footer-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .modal-termos-footer .btn {
    width: 100%;
  }
}

/* Estilos para Dashboard Admin (admin.php) */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0 16px 0;
}
.dashboard-cards.panel {
  background: transparent;
  border: none;
  padding: 0;
}
.dashboard-cards .card {
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: 10px;
  box-shadow: none;
  padding: 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 90px;
  transition: background .2s ease;
}
.dashboard-cards .card:hover {
  transform: none;
  box-shadow: none;
}
.dashboard-cards .card h3 {
  margin: 0;
  color: #9aa4b2;
  font-size: 1.05rem;
  font-weight: 600;
}
.dashboard-cards .card span {
  display: block;
  margin-top: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

@media (max-width: 900px) {
  .dashboard-cards .card {
    min-height: 80px;
  }
}

/* Variante KPI estilo Velzon (admin.php) */
.dashboard-cards.dashboard-cards--velzon {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #212529;
  border: 1px solid #2a3648;
  border-radius: 4px;
  overflow: hidden;
}

.dashboard-cards.dashboard-cards--velzon .card {
  background: #212529;
  border: none;
  border-left: 1px solid #2a3648;
  border-radius: 0;
  box-shadow: none;
  flex: 1 1 230px;
  min-height: 102px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}

.dashboard-cards.dashboard-cards--velzon .card:first-child {
  border-left: none;
}

.dashboard-cards.dashboard-cards--velzon .kpi-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 20px;
}

.dashboard-cards.dashboard-cards--velzon .card h3 {
  margin: 0;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-cards.dashboard-cards--velzon .kpi-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.56rem;
  line-height: 1;
}

.dashboard-cards.dashboard-cards--velzon .kpi-indicator.ok {
  color: #0ab39c;
}

.dashboard-cards.dashboard-cards--velzon .kpi-indicator.danger {
  color: #f06548;
}

.dashboard-cards.dashboard-cards--velzon .kpi-body {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
}

.dashboard-cards.dashboard-cards--velzon .kpi-body i {
  font-size: 2rem;
  color: #8b96ae;
  opacity: 0.95;
  width: 34px;
  flex: 0 0 34px;
  text-align: center;
}

.dashboard-cards.dashboard-cards--velzon .card span {
  margin: 0;
  color: #ced4da;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
}

.dashboard-graphs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.dashboard-graphs > div {
  background: #1a1d21;
  border: 1px solid #32383e;
  box-shadow: none;
  border-radius: 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.dashboard-graphs .panel,
.dashboard-graphs .panel + .panel {
  margin-top: 0;
  margin-bottom: 0;
}
.dashboard-graphs .graph-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #32383e;
}
.dashboard-graphs .graph-card-header h4 {
  margin: 0;
  color: #ced4da;
  font-size: 1.06rem;
  font-weight: 600;
}
.dashboard-graphs .graph-card-sort {
  color: #878a99;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-graphs .graph-card-body {
  padding: 12px 12px 10px 12px;
  flex: 1;
  min-height: 320px;
}
.dashboard-graphs canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 290px;
  background: transparent;
  border-radius: 0;
  margin: 0;
}
@media (max-width:900px) {.dashboard-graphs { grid-template-columns:1fr; }}
.mesano-label { /* Corrigido: seletor para o span dentro do h2 */
  color:#687cfe; 
  font-size:1rem; 
  margin-left: 8px;
}

/* Media query para menu lateral mobile - agrupada aqui para melhor organização */
@media (max-width: 700px) { /* Ajustado de 900px para menu colapsado para 700px para menu off-canvas */
  .menu-lateral {
    position: fixed; /* Garante que é fixed para sobrepor */
    left: -236px; /* Começa fora da tela */
    top: 64px; /* Abaixo do header */
    width: 236px; /* Largura do menu quando aberto */
    z-index: 1001; /* Acima do overlay e conteúdo */
    transition: left 0.27s cubic-bezier(.8,.1,.22,1.2);
  }
  .menu-lateral.open { left: 0; } /* Mostra o menu */
  .dashboard-main { margin-left: 0; } /* Conteúdo principal ocupa tudo quando menu está escondido */
  .menu-mobile-toggle { display: block; } /* Mostra o botão de toggle */
}

/* ... outros estilos ... */

.btn-limpar-filtros {
  background: #e7f3fa; /* Cor de fundo clara */
  color: #1b476d; /* Cor de texto escura */
  border: 1px solid #c5d9e8; /* Borda suave */
  text-decoration: none; /* garante ausência de sublinhado para anchors */
}
.btn-limpar-filtros:hover {
  background: #dceaf5;
  color: #133a57;
}

.paginacao-container {
  margin: 24px 0;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap; /* Para melhor responsividade se houver muitos botões de página */
}

/* ... restantes estilos ... */
/* Para index.php */
.login-numerico-container {
  display: none;
  max-width: 420px;
  margin: 48px auto 0 auto;
}
.pin-dots-container {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  gap: 5px;
}
.login-numerico-container .pin-input { /* Especificidade para o input de PIN nesta secção */
    margin-bottom: 18px;
}
.login-numerico-container .teclado-btn { /* Especificidade para os botões do teclado nesta secção */
    font-size: 1.15em;
}
.login-numerico-container .btn-row {
    margin-top: 9px;
}

/* Para reparacoes.php */
.form-inline {
  display: inline;
}
.form-no-margin {
  margin: 0;
}

/* Para paginação em registos_entrada_saida.php e registos_reparacoes.php */
.paginacao-reticencias {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 2px;
  color: #878A99;
}

/* --- Toolbar de filtros (admin_ferias) --- */
.table-toolbar .filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;              /* linhas x colunas */
  align-items: end;             /* alinha ao fundo para uniformizar baseline */
}
.table-toolbar .filter-form .form-group {
  display: flex;
  flex-direction: column;
  margin: 0;                    /* retira margens verticais excessivas */
  min-width: 180px;
}
.table-toolbar .filter-form .form-group label { margin-bottom: 6px; }
.table-toolbar .filter-form input[type="date"],
.table-toolbar .filter-form input[type="text"],
.table-toolbar .filter-form select {
  width: 100%;
  height: 42px;
  padding: 10px 13px;
  border: 1px solid #bed3e7;
  border-radius: 7px;
  font-size: 1rem;
  box-sizing: border-box;
}
.table-toolbar .filter-form input[type="checkbox"] {
  width: 18px; height: 18px;
}
.table-toolbar .filter-form .btn,
.table-toolbar .filter-form button[type="submit"] {
  align-self: end;              /* alinha botão com a linha dos campos */
  height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Alinhamento horizontal do checkbox + label (sem estilos inline) */
.table-toolbar .filter-form .form-group.checkbox-inline {
  flex-direction: row; align-items: center; gap: 8px; min-width: unset;
}

/* Grupo de ações (botões) lado a lado e alinhados pela base */
.table-toolbar .filter-form .form-group.actions {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: unset;
}

/* Responsivo: otimiza espaçamentos em ecrãs mais pequenos */
@media (max-width: 768px) {
  /* Em tablets/telemóveis, usar layout em coluna para evitar "saltos" verticais */
  .table-toolbar .filter-form {
    display: grid;
    grid-template-columns: 1fr;   /* uma coluna para evitar desalinhamentos */
    gap: 10px;                    /* espaçamento compacto e consistente */
    align-items: start;            /* evita espaços verticais entre grupos */
  }
  .table-toolbar .filter-form .form-group { min-width: 0; }
  .table-toolbar .filter-form .btn,
  .table-toolbar .filter-form button[type="submit"] { height: 40px; }
}

@media (max-width: 480px) {
  .container { padding: 20px 14px; }
  .panel { padding: 12px; }
  .panel-header { padding: 8px 10px 10px 10px; margin: -12px -12px 10px -12px; }
  .table-toolbar .filter-form { gap: 8px 10px; }
  .table-toolbar .filter-form .form-group label { margin-bottom: 4px; }
  .table-toolbar .filter-form input[type="date"],
  .table-toolbar .filter-form input[type="text"],
  .table-toolbar .filter-form select { height: 40px; }
}

/* Para editar_utilizador.php */
.label-nota {
  font-weight: normal;
  color: #aaa; /* Considerar usar uma variável CSS se esta cor for reutilizada */
}
@media (prefers-color-scheme: dark) {
  .label-nota {
    color: #777; /* Ajustar para dark mode */
  }
}

.nova-reparacao {
  margin-bottom: 28px;
}

/* --- Estilos da Legenda de Cores --- */
.color-legend {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    flex-wrap: wrap; /* Para ecrãs mais pequenos */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.legend-text {
    font-size: 0.9em;
    font-weight: 500;
    color: #495057;
}

/* Aplicar as cores aos pontos da legenda */
.legend-dot.status-entrada { background-color: #28a745; }
.legend-dot.status-pausa { background-color: #ffc107; }
.legend-dot.status-reparacao { background-color: #007bff; }
.legend-dot.status-ausente { background-color: #dc3545; }


/* Secção de formulário ou "cartão" */
.form-section {
    background-color: var(--background-color-light);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

/* Quando uma .form-section vive dentro de um .panel, não precisamos de novo “cartão” interno */
.panel .form-section {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0 0 1rem 0; /* pequeno espaçamento inferior apenas */
}
.panel .form-section h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: .75rem;
}

.form-section h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.form-section h3 i {
    margin-right: 10px;
    color: var(--primary-color);
}

/* Tabs de Configuracoes */
.settings-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
  align-items: start;
}
.settings-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-content {
  min-width: 0;
}
.settings-tab-link {
  background: var(--background-color-hover, #eef5fb);
  border: 1px solid var(--border-color, #e3eaf6);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.settings-nav .settings-tab-link {
  width: 100%;
  text-align: left;
}
.settings-tab-link.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-light);
}
.settings-tab-content {
  display: none;
}
.settings-tab-content.active {
  display: block;
}
@media (max-width: 900px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .settings-nav .settings-tab-link {
    text-align: center;
    flex: 1 1 140px;
  }
}

/* Garante que a tabela é responsiva em ecrãs pequenos */
.table-responsive {
    overflow-x: auto;
}

/* ==========================================================================
   Estilos dos Cartões de Utilizador (Login)
   ========================================================================== */

/* 1. Estrutura Base do Cartão (comum a todos os modos) */
.utilizador-card {
    border-radius: 20px;
    padding: 30px 32px 18px 32px;
    text-align: center;
    cursor: pointer;
    border: 1.6px solid transparent; /* Borda base transparente */
    border-left-width: 5px; /* Espaço para a cor de status */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 140px;
    max-width: 175px;
    transition: transform 0.14s, box-shadow 0.16s, border-color 0.15s, background-color 0.3s;
    user-select: none;
    position: relative;
}

.utilizador-card:hover,
.utilizador-card:focus {
    transform: translateY(-4px) scale(1.06);
    border-color: #23c0f7;
    box-shadow: 0 7px 38px #24e3d7aa, 0 3px 16px #24b0e944;
}


/* 3. Estilos para Modo Escuro */
@media (prefers-color-scheme: dark) {
    /* O cartão de admin (sem classe de status) fica com o fundo escuro padrão */
    .utilizador-card {
        background: linear-gradient(135deg, #242f44 85%, #263b59 100%);
        border-color: transparent;
        border-left-color: transparent;
    }

    /* Cores para os status dos empregados */
    .utilizador-card.status-entrada {
        background: linear-gradient(135deg, #2b442d 85%, #2f4b31 100%);
        border-left-color: #52c41a;
    }
    .utilizador-card.status-reparacao {
        background: linear-gradient(135deg, #243a50 85%, #263b59 100%);
        border-left-color: #1890ff;
    }
    .utilizador-card.status-pausa {
        background: linear-gradient(135deg, #544524 85%, #594b28 100%);
        border-left-color: #faad14;
    }
    .utilizador-card.status-ausente {
        background: linear-gradient(135deg, #4d2c2f 85%, #533033 100%);
        border-left-color: #f5222d;
    }
}

/* 4. Estilo do Número da Reparação (comum a ambos os modos) */
.reparacao-numero {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.85em;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1890ff, #007bff);
    padding: 4px 10px;
    border-radius: 12px;
    line-height: 1.2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.reparacao-numero::before { content: "Nª Rep.: "; font-weight: 600; opacity: 0.9; }

/* Mostra o número da reparação apenas quando o cartão tem a classe de status de reparação */
.utilizador-card.status-reparacao .reparacao-numero {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* --- Estilos para Opções Avançadas Colapsáveis (configuracoes.php) --- */
.advanced-options {
  margin-top: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  background: var(--background-color-hover);
  transition: background .2s, border-color .2s;
}

.advanced-options summary {
  font-weight: 600;
  color: var(--primary-color);
  cursor: pointer;
  padding: 0.5rem 0;
  outline: none; /* Remove o contorno de foco padrão */
  transition: color .2s;
}

.advanced-options[open] > summary {
  margin-bottom: 1rem;
}

.advanced-options .form-2col {
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
  transition: border-color .2s;
}

body.dark-mode .advanced-options {
    background: var(--bg-table-even);
    border-color: var(--card-border);
}

/* ==========================================================================
   Topbar + Sidebar (Velzon-like)
   ========================================================================== */
:root {
  --layout-sidebar-w: 236px;
  --layout-header-h: 70px;
}

.header-fixo {
  height: var(--layout-header-h);
  padding: 0;
  display: grid;
  grid-template-columns: var(--layout-sidebar-w) 1fr;
  align-items: stretch;
  background: #212529;
  border-bottom: 1px solid #32383e;
  box-shadow: none;
  z-index: 1002;
}

.header-brand-block {
  background: #212529;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.header-brand-block img {
  height: 52px;
  width: auto;
}

.header-topbar-main {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 0 24px 0 12px;
  background: #212529;
  color: #ced4da;
  font-family: 'Poppins', 'Segoe UI', Arial, sans-serif;
  font-size: 13px;
}

.header-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-mobile-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  border: 1px solid #3a4658;
  background: #1f2835;
  color: #a8b4c7;
  font-size: 1rem;
  padding: 0;
}

.menu-mobile-toggle:hover {
  background: #233044;
  color: #dce4f2;
}

.topbar-search {
  position: relative;
  width: 240px;
}

.topbar-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8494aa;
  font-size: 0.86rem;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  border: 1px solid #344255;
  border-radius: 6px;
  background: #1f2835;
  color: #dbe4f1;
  padding: 0 12px 0 34px;
  font-family: 'Public Sans', 'Poppins', sans-serif;
  font-size: 0.92rem;
}

.topbar-icon {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #9aa4b2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.topbar-icon:hover {
  background: transparent;
  color: #9aa4b2;
  box-shadow: none;
}

.topbar-icon:focus,
.topbar-icon:focus-visible,
.topbar-icon:active {
  background: transparent;
  color: #9aa4b2;
  border: none;
  box-shadow: none;
  outline: none;
}

.topbar-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #f06548;
  color: #fff;
  font-size: 0.63rem;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}

.topbar-badge.is-hidden {
  display: none;
}

.topbar-notifications {
  position: relative;
}

.topbar-notif-dropdown {
  position: absolute;
  top: 40px;
  right: 0;
  width: min(360px, 88vw);
  background: #212529;
  border: 1px solid #2a3038;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 1200;
  overflow: hidden;
}

.topbar-notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #2a3038;
  color: #e6edf5;
}

.topbar-notif-markall {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #323b45;
  border-radius: 6px;
  background: #212529;
  color: #ced4da;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  cursor: pointer;
}

.topbar-notif-markall:hover {
  background: #212529;
  border-color: #323b45;
  color: #ced4da;
  box-shadow: none;
  transform: none;
}

.topbar-notif-markall:focus,
.topbar-notif-markall:focus-visible,
.topbar-notif-markall:active {
  outline: none;
  box-shadow: none;
  border-color: #3a4552;
}

.topbar-notif-list {
  max-height: 360px;
  overflow: auto;
}

.topbar-notif-empty {
  padding: 12px;
  color: #9aa4b2;
  font-size: 0.86rem;
}

.topbar-notif-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid #2a3038;
  color: #d7dfeb;
  text-decoration: none;
  background: #212529;
}

.topbar-notif-item:hover {
  background: #282b2e;
}

.topbar-notif-item.unread {
  background: #262a2f;
}

.topbar-notif-item-message {
  display: block;
  font-size: 0.9rem;
  line-height: 1.25;
}

.topbar-notif-item-date {
  display: block;
  margin-top: 4px;
  font-size: 0.76rem;
  color: #9aa4b2;
}

.topbar-userchip {
  height: calc(var(--layout-header-h) - 2px);
  border-radius: 0;
  padding: 0 16px;
  background: #32383d;
  border-top: none;
  border-bottom: none;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ced4da;
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #556ee6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-usermeta {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.topbar-usermeta strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
}

.topbar-usermeta small {
  font-size: 0.79rem;
  color: #878a99;
  opacity: 1;
}

.menu-lateral {
  top: var(--layout-header-h) !important;
  width: var(--layout-sidebar-w) !important;
  border-right: none !important;
}

.dashboard-main {
  margin-left: var(--layout-sidebar-w) !important;
  border-left: none !important;
}

.header-brand-block {
  border-right: none !important;
}

@media (max-width: 700px) {
  .header-fixo {
    grid-template-columns: 1fr;
  }

  .header-brand-block {
    display: none;
  }

  .topbar-search {
    width: 180px;
  }

  .topbar-usermeta {
    display: none;
  }

  .menu-mobile-toggle {
    display: inline-flex;
  }

  .menu-lateral {
    left: calc(-1 * var(--layout-sidebar-w)) !important;
    top: var(--layout-header-h) !important;
  }

  .menu-lateral.open {
    left: 0 !important;
  }

  .dashboard-main {
    margin-left: 0 !important;
  }
}

/* ===== Filtros (estilo unificado) ===== */
.dashboard-main .filtro-form,
.dashboard-main .table-toolbar .filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  width: 100%;
  max-width: none;
  margin: 0;
}

.dashboard-main .filtro-form .filter-field,
.dashboard-main .table-toolbar .filter-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 200px;
  min-width: 170px;
  margin: 0;
}

.dashboard-main .filtro-form .filter-action,
.dashboard-main .filtro-form .filter-action-btn,
.dashboard-main .table-toolbar .filter-form .form-group.actions,
.dashboard-main .table-toolbar .filter-form > .btn {
  flex: 0 0 auto;
  min-width: 120px;
}

.dashboard-main .filtro-form .filter-action {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dashboard-main .filtro-form .filter-action-btn {
  align-self: flex-end;
}

.dashboard-main .filtro-form label,
.dashboard-main .table-toolbar .filter-form label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #878A99;
}

.dashboard-main .filtro-form input[type="text"],
.dashboard-main .filtro-form input[type="date"],
.dashboard-main .filtro-form select,
.dashboard-main .table-toolbar .filter-form input[type="text"],
.dashboard-main .table-toolbar .filter-form input[type="date"],
.dashboard-main .table-toolbar .filter-form select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #2f3643;
  background: #262a2f;
  color: #ced4da;
  box-shadow: none;
}

.dashboard-main .filtro-form select,
.dashboard-main .table-toolbar .filter-form select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%238b97ad' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.dashboard-main .filtro-form input::placeholder,
.dashboard-main .table-toolbar .filter-form input::placeholder {
  color: #878A99;
  opacity: 1;
}

.dashboard-main .filtro-form .btn,
.dashboard-main .table-toolbar .filter-form .btn,
.dashboard-main .filtro-form button[type="submit"],
.dashboard-main .table-toolbar .filter-form button[type="submit"] {
  height: 42px;
  border-radius: 6px;
  padding: 0 18px;
  border: 1px solid #556ee6;
  background: #556ee6;
  color: #f8f9fc;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
}

.dashboard-main .btn-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
}

.dashboard-main .btn-filter i {
  font-size: 0.85rem;
}

/* Ajuste do filtro do admin para alinhar margens com os cards */
.dashboard-main .admin-filter-panel {
  padding: 0;
  margin-bottom: 12px;
  background: transparent;
  border: none;
}

.dashboard-main .admin-filter-panel .filtro-form {
  margin: 0;
}

.dashboard-main .admin-filter-panel .filter-field {
  flex: 1 1 260px;
}

.dashboard-main .admin-filter-panel + .dashboard-cards {
  margin-top: 0;
}

.dashboard-main .filtro-form .btn.btn-limpar-filtros,
.dashboard-main .table-toolbar .filter-form .btn.btn-limpar-filtros,
.dashboard-main .table-toolbar .filter-form > .btn.btn-secondary {
  border-color: #313947;
  background: #2a313d;
  color: #c6cfdd;
}

.dashboard-main .filtro-form .btn:hover,
.dashboard-main .table-toolbar .filter-form .btn:hover,
.dashboard-main .filtro-form button[type="submit"]:hover,
.dashboard-main .table-toolbar .filter-form button[type="submit"]:hover {
  filter: brightness(1.06);
}

@media (max-width: 900px) {
  .dashboard-main .filtro-form .filter-field,
  .dashboard-main .table-toolbar .filter-form .form-group {
    flex: 1 1 calc(50% - 12px);
    min-width: 140px;
  }
}

@media (max-width: 640px) {
  .dashboard-main .filtro-form .filter-field,
  .dashboard-main .table-toolbar .filter-form .form-group,
  .dashboard-main .filtro-form .filter-action,
  .dashboard-main .table-toolbar .filter-form .form-group.actions,
  .dashboard-main .table-toolbar .filter-form > .btn {
    flex: 1 1 100%;
  }
}

/* ===== Lista estilo Velzon (Entradas/Saídas + Reparações) ===== */
.records-page .records-list-panel {
  padding: 0;
  border-radius: 6px;
  border: 1px solid #2a3038;
  background: #212529;
  overflow: hidden;
}

.records-page .records-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 16px 18px;
  border-bottom: 1px dashed #2a3038;
}

.records-page .records-list-head h2 {
  margin: 0;
  color: #e2e8f0;
  font-size: 24px;
  font-weight: 700;
}

.records-page .records-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.records-page .records-head-actions .btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 40px;
  display: inline-flex;
  align-items: center;
  box-shadow: none;
  transform: none;
}

.records-page .records-head-actions .btn i {
  margin-right: 8px;
  font-size: 0.9rem;
}

.records-page .records-head-actions .btn-info-head {
  border-color: #299cdb;
  background: #299cdb;
  color: #fff;
}

.records-page .records-head-actions .btn-danger-head {
  border-color: #e55353;
  background: #e55353;
  color: #fff;
}

.records-page .records-head-actions .btn-info-head:hover,
.records-page .records-head-actions .btn-danger-head:hover {
  filter: brightness(1.08);
}

.records-page .records-filter-form {
  padding: 16px 18px;
  border-bottom: 1px solid #2a3038;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
}

.records-page .records-filter-form .filter-field {
  position: relative;
  flex: 1 1 200px;
}

.records-page .records-filter-form .filter-field--wide {
  flex: 2.4 1 520px;
}

.records-page .records-filter-form .filter-field--date {
  flex: 0 1 255px;
}

.records-page .records-filter-form label {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.records-page .records-filter-form .filter-action {
  min-width: 140px;
  flex: 0 0 auto;
}

.records-page .records-filter-form .filter-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #7f8aa1;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 2;
}

.records-page .records-filter-form .filter-search-input {
  padding-left: 38px !important;
}

@media (max-width: 1100px) {
  .records-page .records-filter-form .filter-field--wide {
    flex: 1 1 100%;
  }

  .records-page .records-filter-form .filter-field--date,
  .records-page .records-filter-form .filter-action {
    flex: 1 1 calc(50% - 8px);
    min-width: 180px;
  }
}

@media (max-width: 760px) {
  .records-page .records-list-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .records-page .records-filter-form .filter-field,
  .records-page .records-filter-form .filter-action {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

.records-page .records-table-wrap {
  overflow-x: auto;
}

.records-page .records-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.records-page .records-table th,
.records-page .records-table td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid #2a3038;
  font-size: 0.98rem;
  color: #ced4da;
}

.records-page .records-table td {
  background: #212529;
}

.records-page .records-table th {
  background: #282b2e;
  color: #878A99;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.records-page .records-table tr {
  background: #212529;
}

.records-page .records-table tr:nth-child(even) td {
  background: #212529;
}

.records-page .records-table tr:hover td {
  background: #212529;
  color: #ced4da;
  transition: none;
}

.records-page .tabela-registos tr:hover td {
  background: #212529;
  color: #ced4da;
  transition: none;
}

.records-page .records-table .tipo-entrada,
.records-page .records-table .tipo-saida,
.records-page .records-table .tipo-pausa {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.records-page .records-table .tipo-entrada {
  color: #0ab39c;
  background: rgba(10, 179, 156, 0.18);
}

.records-page .records-table .tipo-saida {
  color: #f46a6a;
  background: rgba(244, 106, 106, 0.18);
}

.records-page .records-table .tipo-pausa {
  color: #f1b44c;
  background: rgba(241, 180, 76, 0.2);
}

.records-page .records-table .ponto-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.records-page .records-table .ponto-status-badge.manual {
  color: #a5b0c2;
  background: rgba(165, 176, 194, 0.2);
}

.records-page .records-table .ponto-status-badge.pending {
  color: #f1b44c;
  background: rgba(241, 180, 76, 0.2);
}

.records-page .records-table .ponto-status-badge.confirmed {
  color: #0ab39c;
  background: rgba(10, 179, 156, 0.2);
}

.records-page .records-table .ponto-actions-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.records-page .records-table .ponto-actions-inline input[type="time"] {
  min-width: 110px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
}

.records-page .records-table .ponto-actions-inline .btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.records-page .records-table.records-table--rep-detail-sessions th:nth-child(8),
.records-page .records-table.records-table--rep-detail-sessions td:nth-child(8) {
  min-width: 430px;
}

.records-page .records-table .rep-time-correction-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) auto;
  align-items: end;
  gap: 6px;
}

.records-page .records-table .rep-time-correction-form input[type="datetime-local"] {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid #3a475d;
  background: #1c222d;
  color: #dbe4f3;
}

.records-page .records-table .rep-time-correction-form .btn {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  white-space: nowrap;
}

.records-page .records-table .rep-time-correction-form small {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  color: #98a6b8;
}

.records-page .records-table .rep-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.records-page .rep-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.records-page .records-table .rep-status-badge.curso {
  color: #56a3ff;
  background: rgba(86, 163, 255, 0.2);
}

.records-page .rep-status-badge.curso {
  color: #56a3ff;
  background: rgba(86, 163, 255, 0.2);
}

.records-page .records-table .rep-status-badge.pausa {
  color: #f1b44c;
  background: rgba(241, 180, 76, 0.2);
}

.records-page .rep-status-badge.pausa {
  color: #f1b44c;
  background: rgba(241, 180, 76, 0.2);
}

.records-page .records-table .rep-status-badge.concluida {
  color: #0ab39c;
  background: rgba(10, 179, 156, 0.2);
}

.records-page .rep-status-badge.concluida {
  color: #0ab39c;
  background: rgba(10, 179, 156, 0.2);
}

.records-page .records-table .rep-status-badge.auto {
  color: #a5b0c2;
  background: rgba(165, 176, 194, 0.2);
}

.records-page .rep-status-badge.auto {
  color: #a5b0c2;
  background: rgba(165, 176, 194, 0.2);
}

.records-page .records-icon-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #323c4a;
  background: #212529;
  color: #9aa4b2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.records-page .records-icon-action.records-icon-action--view {
  color: #8ea7ff;
}

.records-page .records-icon-action.records-icon-action--export {
  color: #ff7d7d;
}

.records-page .records-icon-action:hover {
  filter: brightness(1.08);
}

.records-page .records-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.records-page .records-list-panel > p {
  margin: 14px 18px;
  color: #878a99;
}

.records-page .records-list-panel .paginacao-container {
  margin: 0;
  padding: 14px 18px;
  justify-content: flex-end;
  gap: 8px;
}

.records-page .records-list-panel .paginacao-container .btn {
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #323b45;
  background: #212529;
  color: #878A99;
}

.records-page .records-list-panel .paginacao-container .btn.active {
  background: #556ee6;
  border-color: #556ee6;
  color: #f8fbff;
}

.records-page .records-list-panel .paginacao-container .btn:hover:not(.active) {
  background: #262d36;
  border-color: #3a4552;
  color: #d7dee8;
}

/* ===== Blocos utilitários para páginas estilo records ===== */
.records-page .records-content {
  padding: 16px 18px;
}

.records-page .records-content .records-table-wrap {
  padding: 0;
}

.records-page .records-note {
  margin-top: 10px;
  color: #9aa4b2;
  font-size: 0.9rem;
}

/* Aviso de auto-fecho pendente (entrada_saida.php) */
.records-page .auto-close-alert.alerta.erro {
  display: block;
  margin: 0 0 16px 0;
  padding: 14px 16px;
  border-left: 4px solid #f1b44c;
  border: 1px solid #6f4f4a;
  background: linear-gradient(180deg, #4a3333 0%, #402d2d 100%);
  color: #f7e9e9;
  box-shadow: none;
}

.records-page .auto-close-alert h4 {
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.04rem;
  font-weight: 700;
  color: #ffe0a8;
}

.records-page .auto-close-alert h4 .fa-exclamation-triangle {
  color: #f1b44c;
}

.records-page .auto-close-alert p {
  margin: 0 0 12px 0;
  color: #f4d7d7;
  line-height: 1.45;
}

.records-page .auto-close-alert .auto-close-alert-help {
  display: block;
  margin: -4px 0 12px 0;
  color: #e8c1c1;
  font-size: 0.86rem;
}

.records-page .auto-close-alert-form {
  gap: 12px 14px;
}

.records-page .auto-close-alert-form label {
  color: #7bd3ff;
  font-weight: 600;
}

.records-page .auto-close-alert-form input[type="time"] {
  max-width: 240px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid #3a4552;
  background: #212529;
  color: #e6ecf2;
}

.records-page .auto-close-alert-form input[type="time"]:focus {
  border-color: #556ee6;
  outline: none;
  box-shadow: none;
}

.records-page .auto-close-alert-actions {
  margin-top: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.records-page .auto-close-alert-actions .btn {
  width: auto !important;
  min-width: 0;
  min-height: 44px;
  border-radius: 6px;
  font-weight: 700;
  padding: 0 14px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  box-shadow: none;
}

.records-page .auto-close-alert-actions .auto-close-btn-confirm {
  background: #2a3038;
  border: 1px solid #3a4552;
  color: #d7dee8;
}

.records-page .auto-close-alert-actions .auto-close-btn-confirm:hover {
  background: #303741;
  border-color: #4a5666;
}

.records-page .auto-close-alert-actions .auto-close-btn-correct {
  background: #556ee6;
  border: 1px solid #556ee6;
  color: #ffffff;
}

.records-page .auto-close-alert-actions .auto-close-btn-correct:hover {
  background: #4a63db;
  border-color: #4a63db;
}

.records-page .records-empty {
  margin: 2px 0 0 0;
  color: #878a99;
}

.records-page .records-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.records-page .records-shortcuts .btn {
  min-height: 40px;
  border-radius: 6px;
  box-shadow: none;
  transform: none;
}

.records-page .records-shortcuts .btn:hover {
  transform: none;
  box-shadow: none;
}

.records-page .registo-ponto-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.records-page .registo-ponto-form .btn-block {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 1rem;
  font-weight: 600;
  box-shadow: none;
  transform: none;
}

.records-page .registo-ponto-form .btn-block:hover,
.records-page .registo-ponto-form .btn-block:focus,
.records-page .registo-ponto-form .btn-block:active {
  transform: none;
  box-shadow: none;
  background-image: none;
  filter: brightness(1.05);
}

.records-page .registo-ponto-form .btn-entrada {
  background: #299cdb;
  border-color: #299cdb;
  color: #fff;
}

.records-page .registo-ponto-form .btn-pausa {
  background: #f1b44c;
  border-color: #f1b44c;
  color: #1f2328;
}

.records-page .registo-ponto-form .btn-saida {
  background: #f06548;
  border-color: #f06548;
  color: #fff;
}

.records-page .registo-ponto-form .btn-block:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  filter: none;
}

.records-page .reparacao-form {
  margin: 0;
}

.records-page .reparacao-form .filter-action {
  min-width: 190px;
}

.records-page .reparacao-form .filter-action .btn {
  width: 100%;
}

@media (max-width: 760px) {
  .records-page .records-shortcuts {
    flex-direction: column;
  }

  .records-page .records-shortcuts .btn {
    width: 100%;
  }

  .records-page .registo-ponto-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .records-page .registo-ponto-form .btn-block {
    height: 46px;
    padding: 0 12px;
    font-size: 0.94rem;
  }

  .records-page .reparacao-form .filter-action {
    min-width: 100%;
  }

  .records-page .auto-close-alert-form .col {
    grid-column: 1 / -1;
  }

  .records-page .auto-close-alert-form input[type="time"] {
    max-width: 100%;
  }

  .records-page .auto-close-alert-actions {
    grid-template-columns: 1fr;
  }

  .records-page .auto-close-alert-actions .btn {
    width: 100%;
    min-height: 42px;
  }
}

/* ===== Colaboradores (estilo lista Velzon) ===== */
.colaboradores-page .records-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.colaboradores-page .records-head-actions .btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 40px;
  display: inline-flex;
  align-items: center;
  box-shadow: none;
  transform: none;
}

.colaboradores-page .records-head-actions .btn i {
  margin-right: 8px;
  font-size: 0.9rem;
}

.colaboradores-page .records-head-actions .btn:hover {
  transform: none;
  box-shadow: none;
}

.colaboradores-page .btn-success-head {
  border-color: #0ab39c;
  background: #0ab39c;
  color: #fff;
}

.colaboradores-page .btn-info-head {
  border-color: #299cdb;
  background: #299cdb;
  color: #fff;
}

.colaboradores-page .records-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid #2a3038;
}

.colaboradores-page .records-tab {
  color: #9aa4b2;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.colaboradores-page .records-tab.active {
  color: #0ab39c;
  border-bottom-color: #0ab39c;
}

.colaboradores-page .records-tab-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(85, 110, 230, 0.25);
  color: #cfd7e4;
  font-size: 0.72rem;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
}


.colaboradores-page .status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.colaboradores-page .status-pill--ok {
  color: #0ab39c;
  background: rgba(10, 179, 156, 0.18);
}

.colaboradores-page .status-pill--off {
  color: #f06548;
  background: rgba(240, 101, 72, 0.18);
}

.colaboradores-page .table-actions-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.colaboradores-page .table-actions-icons .form-inline {
  margin: 0;
}

.colaboradores-page .icon-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid #323c4a;
  background: #212529;
  color: #9aa4b2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
}

.colaboradores-page .icon-action:hover {
  filter: brightness(1.1);
}

.colaboradores-page .icon-action--edit {
  color: #556ee6;
}

.colaboradores-page .icon-action--danger {
  color: #f06548;
}

.colaboradores-page .icon-action--ok {
  color: #0ab39c;
}

.colaboradores-page .icon-action--export-com {
  color: #556ee6;
}

.colaboradores-page .icon-action--export-sem {
  color: #f1b44c;
}

@media (max-width: 900px) {
  .colaboradores-page .records-list-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ===== Formulário de Colaborador (criar/editar) ===== */
.collaborator-form-main {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: calc(var(--layout-header-h) + 10px);
}

.collaborator-form-wrap {
  width: 100%;
  max-width: 620px;
}

.collaborator-form-card {
  background: #212529;
  border: 1px solid #32383e;
  border-radius: 14px;
  padding: 26px 28px 22px 28px;
  position: relative;
}

.collaborator-form-title {
  margin: 0 0 18px 0;
  text-align: left;
  color: #e7ecf4;
  font-size: 2rem;
  font-weight: 600;
  border-bottom: 1px solid #32383e;
  padding-bottom: 14px;
}

.collaborator-form-card .alerta {
  margin-bottom: 12px;
}

.collaborator-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.collaborator-form-grid .col {
  display: flex;
  flex-direction: column;
}

.collaborator-form-grid .col-full {
  grid-column: 1 / -1;
}

.collaborator-form-grid label {
  margin: 0 0 6px 0;
  color: #b7c0cf;
  font-size: 0.97rem;
  font-weight: 600;
}

.collaborator-form-grid input,
.collaborator-form-grid select {
  height: 46px;
  border-radius: 6px;
  border: 1px solid #32383e;
  background: #262a2f;
  color: #d7dce4;
  padding: 0 12px;
}

.collaborator-form-grid input:focus,
.collaborator-form-grid select:focus {
  border-color: #556ee6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(85, 110, 230, 0.14);
}

.collaborator-form-grid .label-nota {
  margin-top: 4px;
  color: #9aa4b2;
  font-size: 0.86rem;
}

.collaborator-checkbox-line {
  flex-direction: row !important;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.collaborator-checkbox-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

.collaborator-checkbox-line label {
  margin: 0;
  color: #b7c1d1;
}

.collaborator-form-grid .col.collaborator-form-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.collaborator-form-actions .btn {
  min-width: 176px;
  height: 42px;
  border-radius: 6px;
  padding: 0 18px;
  font-size: 1.02rem;
  line-height: 42px;
  text-align: center;
}

.collaborator-form-actions .btn.btn--secondary {
  order: 1;
  border: 1px solid #32383e;
  background: #2a3038;
  color: #ced4da;
}

.collaborator-form-actions .btn:not(.btn--secondary) {
  order: 2;
  border: 1px solid #0ab39c;
  background: #0ab39c;
  color: #ffffff;
}

.collaborator-form-actions .btn:not(.btn--secondary):hover {
  background: #0cc3aa;
  border-color: #0cc3aa;
}

@media (max-width: 900px) {
  .collaborator-form-title {
    font-size: 1.7rem;
  }
}

@media (max-width: 720px) {
  .collaborator-form-card {
    padding: 26px 22px 22px 22px;
  }
}


@media (max-width: 700px) {
  .collaborator-form-grid {
    grid-template-columns: 1fr;
  }

  .collaborator-form-grid .col.collaborator-form-actions {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
  }

  .collaborator-form-actions .btn {
    width: auto;
    min-width: 140px;
  }
}

/* ===== Uniformização: Configurações + Legal + Logs ===== */
.settings-page .settings-page-container {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 1480px;
}

.settings-page .page-header {
  margin: 0 0 12px 0;
}

.settings-page .page-title {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #e2e8f0;
}

.settings-page .settings-layout {
  grid-template-columns: 240px 1fr;
  gap: 14px;
  align-items: start;
}

.settings-page .settings-layout > * {
  align-self: start;
  margin-top: 0 !important;
}

.settings-page .settings-nav {
  display: flex;
  flex-direction: column;
  background: #212529;
  border: 1px solid #2a3038;
  border-radius: 6px;
  padding: 10px;
  gap: 8px;
  margin-top: 0 !important;
}

.settings-page .settings-content {
  margin-top: 0 !important;
}

.settings-page .settings-nav-title {
  margin: 8px 4px 2px 4px;
  color: #6f8096;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.settings-page .settings-tab-link {
  background: #212529;
  border: 1px solid #2f3643;
  color: #9aa4b2;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: 600;
}

.settings-page .settings-tab-link:hover {
  color: #e2e8f0;
  border-color: #3b4555;
}

.settings-page .settings-tab-link.active {
  background: #2a3038;
  color: #ffffff;
  border-color: #3e4a5d;
}

.settings-page .settings-tab-content.panel {
  background: #212529;
  border: 1px solid #2a3038;
  border-radius: 6px;
  margin-top: 0 !important;
}

.settings-page .panel-header {
  font-size: 1.22rem;
  font-weight: 700;
  color: #e2e8f0;
}

.settings-page .settings-subsection {
  border: 1px solid #2a3038;
  border-radius: 6px;
  padding: 14px;
  background: #212529;
  margin-bottom: 14px;
}

.settings-page .settings-subsection:last-child {
  margin-bottom: 0;
}

.settings-page .settings-subsection-title {
  margin: 0 0 12px 0;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa4b2;
}

.settings-page .legal-content {
  line-height: 1.68;
  color: #ced4da;
}

.settings-page .legal-content h3 {
  color: #e2e8f0;
  border-bottom: 1px solid #2a3038;
  padding-bottom: 8px;
}

/* Ajuste de alinhamento específico para Termos Legais */
.settings-page.legal-page .settings-layout {
  align-items: start;
}

.settings-page.legal-page .settings-layout > * {
  align-self: start;
  margin-top: 0 !important;
}

.settings-page.legal-page .settings-content {
  margin-top: 0;
}

.settings-page.legal-page .settings-nav {
  margin-top: 0 !important;
}

.settings-page.legal-page .settings-tab-content.panel {
  padding: 0;
  overflow: hidden;
  margin-top: 0 !important;
}

.settings-page.legal-page .settings-tab-content.panel .panel-header {
  margin: 0;
  padding: 14px 18px;
  border-bottom: 1px solid #2a3038;
}

.settings-page.legal-page .settings-tab-content.panel .legal-content {
  padding: 16px 18px 18px;
}

.settings-page.legal-page .settings-tab-content.panel .legal-content h3:first-child {
  margin-top: 0;
}

.settings-page .table-responsive table {
  margin-top: 0;
}

@media (max-width: 1000px) {
  .settings-page .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-page .settings-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }

  .settings-page .settings-nav .settings-tab-link {
    display: block;
    width: 100%;
    flex: 0 0 auto !important;
    min-height: 0;
    text-align: left;
    line-height: 1.25;
    padding: 9px 10px;
  }
}

.logs-page .container {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 1480px;
}

.logs-page .records-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logs-page .records-head-actions .btn {
  height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 40px;
  display: inline-flex;
  align-items: center;
  box-shadow: none;
  transform: none;
}

.logs-page .records-head-actions .btn i {
  margin-right: 8px;
  font-size: 0.9rem;
}

.logs-page .records-head-actions .btn-info-head {
  border-color: #299cdb;
  background: #299cdb;
  color: #fff;
}

.logs-page .records-head-actions .btn-info-head:hover {
  filter: brightness(1.08);
}

.logs-page .records-filter-form .filter-field--wide {
  flex: 2.2 1 480px;
}

.logs-page .records-filter-form .filter-field--date {
  flex: 0 1 220px;
}

.logs-page .records-filter-form .filter-action {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.logs-page .records-table td:nth-child(3) {
  max-width: 420px;
  white-space: normal;
  word-break: break-word;
}

@media (max-width: 900px) {
  .logs-page .records-list-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .logs-page .records-filter-form .filter-action {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}

/* Ajustes finais de uniformizacao para Configuracoes/Legal */
.settings-page .form-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: start;
}

.settings-page .form-2col .col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-page .form-2col .col-full {
  grid-column: 1 / -1;
  margin-top: 0;
}

.settings-page .form-2col label,
.settings-page .form-group label {
  color: #b7c0cf;
  font-size: 0.97rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  letter-spacing: 0;
  text-transform: none;
}

.settings-page .form-2col input[type="text"],
.settings-page .form-2col input[type="email"],
.settings-page .form-2col input[type="password"],
.settings-page .form-2col input[type="number"],
.settings-page .form-2col input[type="date"],
.settings-page .form-2col input[type="time"],
.settings-page .form-2col select,
.settings-page .form-group input[type="text"],
.settings-page .form-group input[type="email"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #32383e;
  background: #262a2f;
  color: #d7dce4;
}

.settings-page .form-2col input:focus,
.settings-page .form-2col select:focus,
.settings-page .form-group input:focus {
  border-color: #556ee6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(85, 110, 230, 0.14);
}

.settings-page .form-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.settings-page .form-2col .col.form-actions,
.settings-page .form-2col .col.col-full.form-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.settings-page .form-2col .btn,
.settings-page .form-actions .btn {
  width: auto !important;
  min-width: 170px;
  height: 42px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #556ee6;
  background: #556ee6;
  color: #f8f9fc;
  box-shadow: none;
  transform: none;
}

.settings-page .form-2col .btn:hover,
.settings-page .form-actions .btn:hover {
  filter: brightness(1.06);
  box-shadow: none;
  transform: none;
}

.settings-page .grant-year-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.settings-page .grant-year-form .grant-year-actions {
  margin-top: 0;
  align-self: end;
}

.settings-page .table-responsive .btn {
  min-width: 110px;
  height: 34px;
  padding: 0 12px;
  font-size: 0.88rem;
  line-height: 34px;
}

.settings-page .checkbox-inline {
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-height: 42px;
}

.settings-page .checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: #cfd6e2;
}

.settings-page .checkbox-inline label {
  margin: 0;
  color: #b7c0cf;
  font-size: 0.97rem;
  font-weight: 600;
}

.settings-page .label-nota {
  color: #9aa4b2;
  font-size: 0.86rem;
  margin-top: 4px;
}

.settings-page .advanced-options {
  background: #212b3a;
  border: 1px solid #2f3a4d;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
}

.settings-page .advanced-options > summary {
  cursor: pointer;
  color: #9fb0c8;
  font-weight: 600;
  margin-bottom: 8px;
}

.settings-page .table-responsive table {
  margin: 0;
  width: 100%;
  border-collapse: collapse;
}

.settings-page .table-responsive th,
.settings-page .table-responsive td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #2a3038;
}

.settings-page .table-responsive th {
  background: #282b2e;
  color: #878A99;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.settings-page .table-responsive td {
  background: #212529;
  color: #ced4da;
}

.settings-page .table-responsive tr:hover td {
  background: #262d36;
  color: #e2e8f0;
}

.settings-page .settings-logo-preview-row {
  display: grid;
  grid-template-columns: minmax(280px, 480px);
  gap: 12px;
  justify-content: start;
}

.settings-page .appearance-form {
  row-gap: 16px;
}

.settings-page .appearance-form .appearance-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: start;
  justify-content: stretch;
  width: 100%;
  max-width: none;
}

.settings-page .appearance-form .appearance-upload-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-page .appearance-form .appearance-upload-col input[type="file"] {
  width: 100%;
  max-width: none;
  height: 42px;
  border: 1px solid #32383e;
  border-radius: 6px;
  background: #262a2f;
  color: #ced4da;
  padding: 0;
  line-height: 40px;
}

.settings-page .appearance-form .appearance-upload-col input[type="file"]::file-selector-button {
  height: 40px;
  border: 0;
  border-right: 1px solid #32383e;
  border-radius: 6px 0 0 6px;
  padding: 0 14px;
  background: #2a3038;
  color: #e2e8f0;
  font-weight: 600;
  cursor: pointer;
}

.settings-page .appearance-form .appearance-upload-col input[type="file"]::-webkit-file-upload-button {
  height: 40px;
  border: 0;
  border-right: 1px solid #32383e;
  border-radius: 6px 0 0 6px;
  padding: 0 14px;
  background: #2a3038;
  color: #e2e8f0;
  font-weight: 600;
  cursor: pointer;
}

.settings-page .appearance-form .appearance-reset-col {
  min-height: auto;
  padding-bottom: 8px;
}

.settings-page .appearance-form .appearance-upload-note {
  margin-top: -8px;
}

.settings-page .appearance-form .form-actions {
  margin-top: 4px;
}

.settings-page .appearance-form .appearance-actions {
  width: 100%;
  max-width: none;
  justify-content: flex-end;
}

.settings-page .settings-logo-preview-card {
  border: 1px solid #32383e;
  border-radius: 10px;
  background: #262a2f;
  padding: 12px;
  width: 100%;
  max-width: none;
}

.settings-page .settings-logo-preview-title {
  display: block;
  font-size: 0.84rem;
  color: #9fb3d1;
  margin-bottom: 8px;
  font-weight: 600;
}

.settings-page .settings-logo-preview-img {
  width: auto;
  max-width: 220px;
  max-height: 80px;
  object-fit: contain;
  display: block;
}

@media (max-width: 860px) {
  .settings-page .appearance-form .appearance-two-col {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .settings-page .appearance-form .appearance-actions {
    justify-content: flex-start;
  }

  .settings-page .appearance-form .appearance-reset-col {
    padding-bottom: 0;
  }

  .settings-page .appearance-form .appearance-upload-note {
    margin-top: 0;
  }
}

@media (max-width: 800px) {
  .settings-page .form-2col {
    grid-template-columns: 1fr;
  }

  .settings-page .grant-year-form {
    grid-template-columns: 1fr;
  }

  .settings-page .form-2col .col-full {
    grid-column: auto;
  }
}

/* Uniformização global de dropdowns */
select {
  background-color: #212529 !important;
}

select option,
select optgroup,
body.dark-mode select option,
body.dark-mode select optgroup {
  background-color: #212529 !important;
}

select option:checked,
select option:hover,
body.dark-mode select option:checked,
body.dark-mode select option:hover {
  background-color: #282b2e !important;
}

/* Força visual do item selecionado em browsers WebKit/Blink (Windows) */
select option:checked,
body.dark-mode select option:checked {
  background: linear-gradient(#282b2e, #282b2e) !important;
  box-shadow: inset 0 0 0 9999px #282b2e !important;
  -webkit-text-fill-color: #eaf6fe !important;
  color: #eaf6fe !important;
}

/* Dropdown custom (Choices.js) */
.choices {
  width: 100%;
  margin: 0;
  font-size: 1rem;
}

.choices__inner {
  min-height: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid #2f3643;
  background: #212529;
  color: #ced4da;
  padding: 0 36px 0 12px;
  display: flex;
  align-items: center;
}

.choices__list--single {
  padding: 0;
  display: flex;
  align-items: center;
  height: 100%;
  color: #ced4da;
}

.choices[data-type*=select-one]::after {
  border-color: #8b97ad transparent transparent;
  right: 12px;
  margin-top: -3px;
}

.choices[data-type*=select-one].is-open::after {
  border-color: transparent transparent #8b97ad;
  margin-top: -7px;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
  background: #212529;
  border: 1px solid #2f3643;
  border-radius: 6px;
  margin-top: 4px;
  color: #eaf6fe;
  z-index: 30;
}

.choices__list--dropdown .choices__item,
.choices__list[aria-expanded] .choices__item {
  padding: 8px 12px;
  color: #eaf6fe;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted,
.choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: #282b2e !important;
  color: #eaf6fe;
}

.choices.is-focused .choices__inner,
.choices.is-open .choices__inner {
  border-color: #556ee6;
}

/* Rodape global */
.app-footer {
  margin-left: var(--layout-sidebar-w);
  padding: 10px 18px 16px;
  border-top: 1px solid #32383e;
  background: #212529;
  color: #878A99;
  font-size: 0.83rem;
}

.app-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.app-footer__left {
  color: #878A99;
}

@media (max-width: 700px) {
  .app-footer {
    margin-left: 0;
    padding: 10px 12px 14px;
  }

  .app-footer__inner {
    padding: 0;
  }
}

/* ==========================================================================
   Login (index.php) - Uniformizado com estilo admin
   ========================================================================== */
body.login-page {
  background: #1a1d21;
  color: #ced4da;
}

body.login-page .login-header {
  margin: 20px auto 8px auto;
  padding-bottom: 4px;
  animation: none;
}

body.login-page .empresa-logo {
  width: 190px;
  height: auto;
  filter: none;
}

body.login-page .empresa-logo:hover {
  transform: none;
}

body.login-page .container.login-user-list,
body.login-page .container.login-numerico-container {
  background: #212529 !important;
  border: 1px solid #32383e !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body.login-page .container.login-user-list {
  margin: 18px auto 0 auto;
  max-width: 1180px;
  padding: 16px;
  align-items: stretch;
}

body.login-page .login-user-list-heading {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px 0;
}

body.login-page .login-user-list h2 {
  margin: 0;
  color: #e2e8f0;
  font-size: 2rem;
  font-weight: 700;
  text-shadow: none;
  letter-spacing: 0;
  text-align: center;
}

body.login-page .login-admin-access {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

body.login-page .login-admin-access-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #3a4557;
  background: #262a2f;
  color: #ced4da;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
}

body.login-page .login-admin-access-btn:hover {
  border-color: #556ee6;
  color: #e2e8f0;
  background: rgba(85, 110, 230, 0.14);
}

@media (max-width: 860px) {
  body.login-page .login-user-list h2 {
    font-size: 1.55rem;
  }

  body.login-page .login-admin-access-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.8rem;
  }
}

@media (max-width: 560px) {
  body.login-page .login-user-list-heading {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 8px;
  }

  body.login-page .login-user-list-heading > :first-child {
    display: none;
  }

  body.login-page .login-user-list h2 {
    font-size: 1.35rem;
    text-align: center;
    line-height: 1.2;
    word-break: normal;
  }

  body.login-page .login-admin-access {
    width: 100%;
    justify-content: center;
  }

  body.login-page .login-admin-access-btn {
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.78rem;
    letter-spacing: 0;
    white-space: nowrap;
  }
}

body.login-page .login-user-tools {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

body.login-page .login-user-search-wrap {
  display: flex;
}

body.login-page .login-user-search-input {
  width: 100%;
  height: 42px;
  border: 1px solid #32383e;
  border-radius: 6px;
  background: #212529;
  color: #ced4da;
  padding: 0 12px;
  font-size: 0.95rem;
}

body.login-page .login-user-search-input:focus {
  border-color: #556ee6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(85, 110, 230, 0.14);
}

body.login-page .login-status-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

body.login-page .login-status-filter-btn {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #32383e;
  border-radius: 6px;
  background: #262a2f;
  color: #9aa4b2;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

body.login-page .login-status-filter-btn:hover {
  background: #2a3038;
  border-color: #3a4557;
  color: #ced4da;
}

body.login-page .login-status-filter-btn.is-active {
  border-color: #556ee6;
  color: #e2e8f0;
  background: rgba(85, 110, 230, 0.16);
}

body.login-page .login-status-filter-btn .filter-count {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #212529;
  border: 1px solid #3a4557;
  color: #ced4da;
  font-size: 0.73rem;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
}

body.login-page .color-legend {
  display: none;
}

body.login-page .legend-dot {
  border-color: transparent;
  box-shadow: none;
}

body.login-page .legend-text {
  color: #9aa4b2;
  font-size: 0.86rem;
  font-weight: 600;
}

body.login-page .utilizadores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 180px));
  gap: 14px;
  justify-content: center;
  align-content: start;
  width: 100%;
}

body.login-page .utilizador-card {
  width: 100%;
  min-width: 150px;
  max-width: 180px;
  border-radius: 8px;
  border: 1px solid #32383e;
  border-left-width: 4px;
  background: #262a2f;
  box-shadow: none;
  transform: none;
  transition: border-color .16s, background .16s;
  padding: 14px 12px 10px 12px;
}

body.login-page .utilizador-card:hover,
body.login-page .utilizador-card:focus {
  transform: none;
  box-shadow: none;
  border-color: #3a4557;
}

body.login-page .utilizador-card.status-entrada {
  background: rgba(10, 179, 156, 0.14);
  border-left-color: #0ab39c;
}

body.login-page .utilizador-card.status-reparacao {
  background: rgba(85, 110, 230, 0.14);
  border-left-color: #556ee6;
}

body.login-page .utilizador-card.status-pausa {
  background: rgba(241, 180, 76, 0.14);
  border-left-color: #f1b44c;
}

body.login-page .utilizador-card.status-ausente {
  background: rgba(240, 101, 72, 0.1);
  border-left-color: #c85a46;
}

body.login-page .utilizador-card .avatar {
  width: 56px;
  height: 56px;
  margin-top: 10px;
  margin-bottom: 8px;
  border: 2px solid #3a4557 !important;
  background: #212529 !important;
  box-shadow: none !important;
}

body.login-page .utilizador-nome {
  color: #e2e8f0;
  font-size: 1rem;
  font-weight: 700;
  text-shadow: none;
}

body.login-page .utilizador-tipo {
  color: #9aa4b2;
  font-size: 0.88rem;
}

body.login-page .container.login-numerico-container {
  max-width: 420px;
  margin: 18px auto 0 auto;
  padding: 16px;
}

body.login-page .login-numerico-header {
  margin: 0 0 12px 0;
  min-height: 88px;
}

body.login-page .login-numerico-header .avatar {
  width: 56px;
  height: 56px;
  border: 2px solid #3a4557;
  background: #212529;
  box-shadow: none;
}

body.login-page .login-numerico-header .nome-utilizador {
  margin-top: 2px;
  color: #e2e8f0;
  font-size: 1.25rem;
  font-weight: 700;
  text-shadow: none;
}

body.login-page .tipo-utilizador {
  color: #9aa4b2;
  font-size: 0.95rem;
  font-weight: 500;
}

body.login-page .pin-dots-container {
  margin-bottom: 12px;
  gap: 6px;
}

body.login-page .pin-dots-container span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px solid #32383e;
}

body.login-page .pin-input {
  background: #212529;
  border: 1px solid #32383e;
  border-radius: 6px;
  color: #e2e8f0;
  height: 46px;
  font-size: 1.2rem;
  letter-spacing: 0.1em;
  box-shadow: none;
  margin-bottom: 12px;
}

body.login-page .pin-input:focus {
  border-color: #556ee6;
  box-shadow: 0 0 0 2px rgba(85, 110, 230, 0.14);
}

body.login-page .teclado-numerico {
  gap: 8px;
  margin-bottom: 12px;
}

body.login-page .teclado-btn {
  background: #258fc8;
  border: 1px solid #258fc8;
  border-radius: 8px;
  box-shadow: none;
  min-height: 52px;
  font-size: 1.35rem;
  font-weight: 700;
  padding: 10px 0;
  line-height: 1;
}

body.login-page .teclado-btn:hover,
body.login-page .teclado-btn:focus,
body.login-page .teclado-btn:active {
  background: #217eb0;
  border-color: #217eb0;
  box-shadow: none;
}

body.login-page .btn-row {
  gap: 10px;
  margin-bottom: 2px;
}

body.login-page .btn-confirm,
body.login-page .btn-cancel {
  border-radius: 8px;
  border: 1px solid transparent;
  min-height: 44px;
  font-size: 1.3rem;
  font-weight: 700;
  box-shadow: none;
  padding: 8px 0;
}

body.login-page .btn-confirm {
  background: #0ab39c;
  border-color: #0ab39c;
  color: #fff;
}

body.login-page .btn-confirm:hover {
  background: #099885;
  border-color: #099885;
}

body.login-page .btn-cancel {
  background: #f06548;
  border-color: #f06548;
  color: #fff;
}

body.login-page .btn-cancel:hover {
  background: #d8553a;
  border-color: #d8553a;
}

body.login-page .menu-bottom-brand {
  margin-top: 10px;
  padding: 6px 0 0 0;
  border-top: 1px solid #32383e;
}

body.login-page .menu-app-name {
  font-size: 1.45rem;
}

body.login-page .menu-app-by {
  color: #9aa4b2;
  font-size: 0.95rem;
}

/* ==========================================================================
   Login Administrativo (admin_login.php)
   ========================================================================== */
body.admin-login-page {
  background: #1a1d21;
  color: #ced4da;
  min-height: 100vh;
}

body.admin-login-page .admin-login-wrap {
  max-width: 460px;
  margin: 44px auto 0 auto;
  padding: 0 14px 24px 14px;
}

body.admin-login-page .admin-login-logo {
  display: block;
  width: 190px;
  height: auto;
  margin: 0 auto 16px auto;
}

body.admin-login-page .admin-login-card {
  background: #212529;
  border: 1px solid #32383e;
  border-radius: 8px;
  padding: 18px;
}

body.admin-login-page .admin-login-card h1 {
  margin: 0 0 14px 0;
  color: #e2e8f0;
  font-size: 1.35rem;
  font-weight: 700;
}

body.admin-login-page .admin-login-form {
  display: grid;
  gap: 8px;
}

body.admin-login-page .admin-login-form label {
  color: #b7c0cf;
  font-size: 0.92rem;
  font-weight: 600;
}

body.admin-login-page .admin-login-form input[type="email"],
body.admin-login-page .admin-login-form input[type="password"] {
  width: 100%;
  height: 42px;
  border: 1px solid #32383e;
  border-radius: 6px;
  background: #212529;
  color: #e2e8f0;
  padding: 0 12px;
}

body.admin-login-page .admin-login-form input:focus {
  border-color: #556ee6;
  outline: none;
  box-shadow: 0 0 0 2px rgba(85, 110, 230, 0.14);
}

body.admin-login-page .admin-login-form .btn {
  margin-top: 4px;
  height: 42px;
  border-radius: 6px;
}

body.admin-login-page .admin-login-inline-link {
  display: inline-block;
  margin: 2px 0 4px 0;
  color: #aab4c6;
  font-size: 0.86rem;
  text-decoration: none;
}

body.admin-login-page .admin-login-inline-link:hover {
  color: #e2e8f0;
}

body.admin-login-page .admin-login-backlink {
  display: inline-block;
  margin-top: 12px;
  color: #9aa4b2;
  font-size: 0.87rem;
  text-decoration: none;
}

body.admin-login-page .admin-login-backlink:hover {
  color: #e2e8f0;
}

/* ==========================================================================
   Responsive Hardening (mobile / tablet / portatil)
   ========================================================================== */

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

@media (max-width: 1366px) {
  .dashboard-main {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .container {
    padding: 24px 22px 20px;
  }
}

@media (max-width: 1024px) {
  :root {
    --layout-sidebar-w: 220px;
  }

  .header-fixo {
    grid-template-columns: 1fr;
  }

  .header-brand-block {
    display: none;
  }

  .header-topbar-main {
    padding: 0 12px;
  }

  .header-topbar-right {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .topbar-userchip {
    padding: 0 10px;
  }

  .topbar-usermeta {
    display: none;
  }

  .menu-mobile-toggle {
    display: inline-flex;
  }

  .menu-lateral {
    left: calc(-1 * var(--layout-sidebar-w)) !important;
    top: var(--layout-header-h) !important;
    z-index: 1001;
  }

  .menu-lateral.open {
    left: 0 !important;
  }

  .overlay-menu {
    z-index: 1000;
  }

  .dashboard-main {
    margin-left: 0 !important;
    padding: calc(var(--layout-header-h) + 12px) 12px 24px !important;
  }

  .app-footer {
    margin-left: 0 !important;
  }

  .container {
    padding: 18px 16px 16px;
  }

  .dashboard-main .filtro-form .filter-field,
  .dashboard-main .table-toolbar .filter-form .form-group,
  .dashboard-main .filtro-form .filter-action,
  .dashboard-main .filtro-form .filter-action-btn,
  .dashboard-main .table-toolbar .filter-form .form-group.actions,
  .dashboard-main .table-toolbar .filter-form > .btn {
    min-width: 0;
    flex: 1 1 calc(50% - 8px);
  }

  .records-page .records-list-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .records-page .records-head-actions {
    width: 100%;
  }

  .records-page .records-head-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .records-page .records-table th,
  .records-page .records-table td {
    padding: 11px 10px;
    font-size: 0.93rem;
  }
}

@media (max-width: 1024px) {
  body.records-detail-page .records-head-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }

  body.records-detail-page .records-head-actions .btn {
    width: auto;
    min-width: 124px;
    flex: 0 0 auto;
    white-space: nowrap;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .header-topbar-main {
    padding: 0 10px;
  }

  .topbar-notif-dropdown {
    width: min(340px, calc(100vw - 20px));
    right: 0;
  }

  .dashboard-main {
    padding: calc(var(--layout-header-h) + 10px) 10px 20px !important;
  }

  .container {
    border-radius: 6px;
    padding: 14px 12px 12px;
  }

  .dashboard-main .filtro-form .filter-field,
  .dashboard-main .table-toolbar .filter-form .form-group,
  .dashboard-main .filtro-form .filter-action,
  .dashboard-main .filtro-form .filter-action-btn,
  .dashboard-main .table-toolbar .filter-form .form-group.actions,
  .dashboard-main .table-toolbar .filter-form > .btn {
    flex: 1 1 100%;
  }

  .records-page .records-table .ponto-actions-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .records-page .records-table .ponto-actions-inline input[type="time"],
  .records-page .records-table .ponto-actions-inline .btn {
    width: 100%;
    min-width: 0;
  }

  .records-page .records-table .rep-time-correction-form {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .records-page .records-table .rep-time-correction-form input[type="datetime-local"],
  .records-page .records-table .rep-time-correction-form .btn {
    width: 100%;
    min-width: 0;
  }

  .paginacao-container {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  :root {
    --layout-header-h: 64px;
  }

  .topbar-userchip {
    display: none;
  }

  .topbar-notif-dropdown {
    width: calc(100vw - 16px);
    right: -6px;
  }

  .records-page .records-list-head h2 {
    font-size: 22px;
  }

  body,
  .dashboard-main,
  .container {
    overflow-x: hidden;
  }
}

/* Corrige sobreposição de labels em tabelas de registos no mobile */
@media (max-width: 520px) {
  .records-page .records-table,
  .records-page .records-table thead,
  .records-page .records-table tbody,
  .records-page .records-table tr,
  .records-page .records-table th,
  .records-page .records-table td {
    display: table;
    width: auto;
  }

  .records-page .records-table {
    display: table;
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
  }

  .records-page .records-table thead {
    display: table-header-group;
  }

  .records-page .records-table tbody {
    display: table-row-group;
  }

  .records-page .records-table tr {
    display: table-row;
  }

  .records-page .records-table th,
  .records-page .records-table td {
    display: table-cell;
    padding: 10px;
    vertical-align: middle;
  }

  .records-page .records-table td::before {
    content: none !important;
    display: none !important;
  }

  .records-page .records-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
  }

  /* Exceção: tabela curta de "Os teus registos de hoje" sem scroll horizontal */
  .records-page .records-table.records-table--today {
    min-width: 0;
    table-layout: fixed;
  }

  .records-page .records-table.records-table--today th,
  .records-page .records-table.records-table--today td {
    padding: 8px 6px;
    font-size: 0.86rem;
    text-overflow: clip;
  }

  /* Mostra o intervalo de pausa completo no mobile */
  .records-page .records-table.records-table--today th:nth-child(1),
  .records-page .records-table.records-table--today td:nth-child(1),
  .records-page .records-table.records-table--today th:nth-child(3),
  .records-page .records-table.records-table--today td:nth-child(3),
  .records-page .records-table.records-table--today th:nth-child(4),
  .records-page .records-table.records-table--today td:nth-child(4) {
    width: 22%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
  }

  .records-page .records-table.records-table--today th:nth-child(2),
  .records-page .records-table.records-table--today td:nth-child(2) {
    width: 34%;
  }

  .records-page .records-table.records-table--today th {
    white-space: normal;
    line-height: 1.15;
  }

  .records-page .records-table.records-table--today td:nth-child(2) {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.2;
  }

  .records-page .records-table.records-table--today + .records-empty,
  .records-page .records-content .records-empty {
    margin-top: 10px;
  }

  /* Exceção: tabela "Reparações de hoje" otimizada para caber no mobile */
  .records-page .records-table-wrap.records-table-wrap--rep-today {
    overflow-x: hidden;
  }

  .records-page .records-table.records-table--rep-today {
    min-width: 0;
    table-layout: fixed;
  }

  .records-page .records-table.records-table--rep-today th,
  .records-page .records-table.records-table--rep-today td {
    padding: 8px 6px;
    font-size: 0.84rem;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    line-height: 1.2;
  }

  .records-page .records-table.records-table--rep-today th {
    font-size: 0.8rem;
  }

  .records-page .records-table.records-table--rep-today th:nth-child(1),
  .records-page .records-table.records-table--rep-today td:nth-child(1) {
    width: 21%;
    white-space: nowrap;
  }

  .records-page .records-table.records-table--rep-today th:nth-child(2),
  .records-page .records-table.records-table--rep-today td:nth-child(2),
  .records-page .records-table.records-table--rep-today th:nth-child(3),
  .records-page .records-table.records-table--rep-today td:nth-child(3) {
    width: 27%;
  }

  .records-page .records-table.records-table--rep-today th:nth-child(5),
  .records-page .records-table.records-table--rep-today td:nth-child(5) {
    width: 25%;
    white-space: nowrap;
  }

  .records-page .records-table.records-table--rep-today .col-mobile-hide {
    display: none;
  }

  /* Tabela admin de Entradas/Saídas: manter data/hora legível no mobile */
  .records-page .records-table.records-table--ponto-admin {
    min-width: 940px;
    table-layout: auto;
  }

  .records-page .records-table.records-table--ponto-admin th,
  .records-page .records-table.records-table--ponto-admin td {
    padding: 8px 8px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .records-page .records-table.records-table--ponto-admin th:nth-child(3),
  .records-page .records-table.records-table--ponto-admin td:nth-child(3) {
    white-space: normal;
    min-width: 190px;
  }

  .records-page .records-table.colaboradores-table {
    min-width: 760px;
    table-layout: auto;
  }

  .records-page .records-table.records-table--logs {
    min-width: 920px;
    table-layout: auto;
  }

  .records-page .records-table.records-table--rep-active {
    min-width: 980px;
    table-layout: auto;
  }

  .records-page .records-table.records-table--rep-detail-summary {
    min-width: 860px;
    table-layout: auto;
  }

  .records-page .records-table.records-table--rep-detail-sessions {
    min-width: 1360px;
    table-layout: auto;
  }

  .records-page .records-table.colaboradores-table th,
  .records-page .records-table.colaboradores-table td,
  .records-page .records-table.records-table--logs th,
  .records-page .records-table.records-table--logs td,
  .records-page .records-table.records-table--rep-active th,
  .records-page .records-table.records-table--rep-active td,
  .records-page .records-table.records-table--rep-detail-summary th,
  .records-page .records-table.records-table--rep-detail-summary td,
  .records-page .records-table.records-table--rep-detail-sessions th,
  .records-page .records-table.records-table--rep-detail-sessions td {
    white-space: nowrap;
  }

  .records-page .records-table.records-table--logs td:nth-child(3),
  .records-page .records-table.records-table--rep-active td:nth-child(6),
  .records-page .records-table.records-table--rep-detail-sessions td:nth-child(7),
  .records-page .records-table.records-table--rep-detail-sessions td:nth-child(8) {
    white-space: normal;
    min-width: 220px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* ==========================================================================
   Admin Dashboard (admin.php) - mobile filter alignment
   ========================================================================== */
@media (max-width: 900px) {
  body.admin-dashboard-page .dashboard-main > .container > h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    margin-bottom: 10px;
  }

  body.admin-dashboard-page .dashboard-main > .container > h2 .mesano-label {
    margin-left: 0;
  }

  body.admin-dashboard-page .admin-filter-panel .filtro-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 10px 12px;
  }

  body.admin-dashboard-page .admin-filter-panel .filtro-form .filter-field,
  body.admin-dashboard-page .admin-filter-panel .filtro-form .filter-action,
  body.admin-dashboard-page .admin-filter-panel .filtro-form .filter-action-btn {
    min-width: 0;
    margin: 0;
  }

  body.admin-dashboard-page .admin-filter-panel .filtro-form .filter-action-btn {
    grid-column: 1 / -1;
    width: 100%;
    justify-content: center;
    align-self: auto;
  }
}

@media (max-width: 640px) {
  body.admin-dashboard-page .admin-filter-panel .filtro-form {
    grid-template-columns: 1fr;
  }

  body.admin-dashboard-page .dashboard-main > .container > h2 {
    font-size: 1.9rem;
  }

  body.admin-dashboard-page .dashboard-main > .container > h2 .mesano-label {
    font-size: 0.96rem;
  }
}

/* ==========================================================================
   Records pages - mobile filter/table tuning
   ========================================================================== */
@media (max-width: 900px) {
  .records-page .records-filter-form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }

  .records-page .records-filter-form .filter-field,
  .records-page .records-filter-form .filter-action {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .records-page .records-filter-form select,
  .records-page .records-filter-form input[type="date"],
  .records-page .records-filter-form input[type="text"] {
    width: 100%;
  }

  .records-page .records-filter-form .filter-action .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .records-page .records-table.records-table--reparacoes-admin {
    min-width: 960px;
    table-layout: auto;
  }

  .records-page .records-table.records-table--reparacoes-admin th,
  .records-page .records-table.records-table--reparacoes-admin td {
    padding: 8px 8px;
    font-size: 0.84rem;
    white-space: nowrap;
  }

  .records-page .records-table.records-table--reparacoes-admin th:nth-child(1),
  .records-page .records-table.records-table--reparacoes-admin td:nth-child(1) {
    min-width: 88px;
  }

  .records-page .records-table.records-table--reparacoes-admin th:nth-child(2),
  .records-page .records-table.records-table--reparacoes-admin td:nth-child(2),
  .records-page .records-table.records-table--reparacoes-admin th:nth-child(3),
  .records-page .records-table.records-table--reparacoes-admin td:nth-child(3) {
    min-width: 108px;
  }
}

@media (max-width: 1024px) {
  body.records-reparacoes-page .records-table-wrap {
    overflow-x: visible;
    width: 100%;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin {
    display: block;
    width: 100% !important;
    max-width: none;
    min-width: 0 !important;
    margin-bottom: 6px;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin tbody {
    display: block;
    width: 100%;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin tr:first-child {
    display: none;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 10px;
    border: 1px solid #2a3038;
    border-radius: 6px;
    background: #212529;
    overflow: hidden;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin td {
    display: flex;
    position: static;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding: 9px 10px;
    padding-left: 10px !important;
    border-bottom: 1px solid #2a3038;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin td:last-child {
    border-bottom: none;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin td::before {
    content: attr(data-label) !important;
    display: inline-block !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    margin: 0;
    flex: 0 0 105px;
    color: #9fb0c9;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin td[data-label="Ações"] {
    justify-content: flex-start;
  }

  body.records-reparacoes-page .records-table.records-table--reparacoes-admin td[data-label="Ações"] .records-actions-inline {
    margin-left: auto;
  }

  body.records-reparacoes-page .records-list-panel .paginacao-container {
    justify-content: center;
    padding: 6px 12px 12px;
  }
}

@media (max-width: 700px) {
  body.records-mobile-cards-page .records-table-wrap {
    overflow-x: visible;
    width: 100%;
  }

  body.records-mobile-cards-page .records-table-wrap.records-table-wrap--rep-today {
    overflow-x: visible;
  }

  body.records-mobile-cards-page .records-table {
    display: block;
    width: 100% !important;
    max-width: none;
    min-width: 0 !important;
    margin-bottom: 6px;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  body.records-mobile-cards-page .records-table thead {
    display: none;
  }

  body.records-mobile-cards-page .records-table tbody {
    display: block;
    width: 100%;
  }

  body.records-mobile-cards-page .records-table tr {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 10px;
    border: 1px solid #2a3038;
    border-radius: 6px;
    background: #212529;
    overflow: hidden;
  }

  body.records-mobile-cards-page .records-table td {
    display: flex;
    position: static;
    align-items: flex-start;
    gap: 10px;
    width: 100% !important;
    padding: 9px 10px;
    padding-left: 10px !important;
    border-bottom: 1px solid #2a3038;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.records-mobile-cards-page .records-table td:last-child {
    border-bottom: none;
  }

  body.records-mobile-cards-page .records-table td[colspan] {
    display: block;
    text-align: left;
  }

  body.records-mobile-cards-page .records-table td[colspan]::before {
    content: none !important;
    display: none !important;
  }

  body.records-mobile-cards-page .records-table td::before {
    content: attr(data-label) !important;
    display: inline-block !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    margin: 0;
    flex: 0 0 110px;
    color: #9fb0c9;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.25;
  }

  body.records-mobile-cards-page .records-table.records-table--rep-today td[data-label="Início"],
  body.records-mobile-cards-page .records-table.records-table--rep-today td[data-label="Fim"],
  body.records-mobile-cards-page .records-table.records-table--rep-today td[data-label="Duração"] {
    white-space: nowrap !important;
    overflow-wrap: normal;
    word-break: normal;
  }

  body.records-mobile-cards-page .records-table.records-table--rep-today td[data-label="Início"]::before,
  body.records-mobile-cards-page .records-table.records-table--rep-today td[data-label="Fim"]::before,
  body.records-mobile-cards-page .records-table.records-table--rep-today td[data-label="Duração"]::before {
    flex-basis: 88px;
  }

  body.records-mobile-cards-page .records-table td[data-label="Ações"] {
    justify-content: flex-start;
  }

  body.records-mobile-cards-page .records-table td[data-label="Ações"] .records-actions-inline,
  body.records-mobile-cards-page .records-table td[data-label="Ações"] .table-actions-icons,
  body.records-mobile-cards-page .records-table td[data-label="Ações"] .ponto-actions-inline,
  body.records-mobile-cards-page .records-table td[data-label="Ações"] .rep-actions-inline {
    margin-left: auto;
  }

  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Entrada"],
  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Pausa"],
  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Saída"],
  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Duração"] {
    white-space: nowrap !important;
    overflow-wrap: normal;
    word-break: normal;
  }

  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Entrada"]::before,
  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Pausa"]::before,
  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Saída"]::before,
  body.records-mobile-cards-page .records-table.records-table--today td[data-label="Duração"]::before {
    flex-basis: 86px;
  }

  body.records-mobile-cards-page .records-list-panel .paginacao-container {
    justify-content: center;
    padding: 6px 12px 12px;
  }
}

@media (max-width: 520px) {
  .settings-page .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable both-edges;
  }

  .settings-page .table-responsive table,
  .settings-page .table-responsive thead,
  .settings-page .table-responsive tbody,
  .settings-page .table-responsive tr,
  .settings-page .table-responsive th,
  .settings-page .table-responsive td {
    display: table;
    width: auto;
  }

  .settings-page .table-responsive table {
    display: table;
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
  }

  .settings-page .table-responsive thead {
    display: table-header-group;
  }

  .settings-page .table-responsive tbody {
    display: table-row-group;
  }

  .settings-page .table-responsive tr {
    display: table-row;
  }

  .settings-page .table-responsive th,
  .settings-page .table-responsive td {
    display: table-cell;
    white-space: nowrap;
  }

  .settings-page .table-responsive td::before {
    content: none !important;
    display: none !important;
  }
}

@media (max-width: 768px) {
  body.records-detail-page .records-table-wrap {
    overflow-x: visible;
  }

  body.records-detail-page .records-table.records-table--rep-detail-summary thead,
  body.records-detail-page .records-table.records-table--rep-detail-summary tbody,
  body.records-detail-page .records-table.records-table--rep-detail-sessions thead,
  body.records-detail-page .records-table.records-table--rep-detail-sessions tbody {
    display: block;
    width: 100%;
  }

  body.records-detail-page .records-table.records-table--rep-detail-summary,
  body.records-detail-page .records-table.records-table--rep-detail-sessions {
    display: block;
    min-width: 0 !important;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  body.records-detail-page .records-table.records-table--rep-detail-summary tr:first-child,
  body.records-detail-page .records-table.records-table--rep-detail-sessions tr:first-child {
    display: none;
  }

  body.records-detail-page .records-table.records-table--rep-detail-summary tr,
  body.records-detail-page .records-table.records-table--rep-detail-sessions tr {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    border: 1px solid #2a3038;
    border-radius: 6px;
    background: #212529;
    overflow: hidden;
  }

  body.records-detail-page .records-table.records-table--rep-detail-summary td,
  body.records-detail-page .records-table.records-table--rep-detail-sessions td {
    display: flex;
    position: static;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    padding-left: 10px !important;
    padding: 9px 10px;
    border-bottom: 1px solid #2a3038;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  body.records-detail-page .records-table.records-table--rep-detail-summary td:last-child,
  body.records-detail-page .records-table.records-table--rep-detail-sessions td:last-child {
    border-bottom: none;
  }

  body.records-detail-page .records-table.records-table--rep-detail-summary td::before,
  body.records-detail-page .records-table.records-table--rep-detail-sessions td::before {
    content: attr(data-label) !important;
    display: inline-block !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    margin: 0;
    flex: 0 0 120px;
    color: #9fb0c9;
    font-weight: 600;
    font-size: 0.82rem;
    line-height: 1.25;
  }
}

/* ==========================================================================
   Installer (scripts/install.php) - visual alinhado com páginas admin
   ========================================================================== */
body.install-admin-page {
  background: #1a1d21;
  color: #ced4da;
}

body.install-admin-page .login-header {
  margin: 20px auto 8px auto;
  padding-bottom: 4px;
  animation: none;
}

body.install-admin-page .empresa-logo {
  width: 190px;
  height: auto;
  filter: none;
}

body.install-admin-page .empresa-logo:hover {
  transform: none;
}

body.install-admin-page .collaborator-form-main {
  padding-top: 8px;
}

body.install-admin-page .collaborator-form-wrap {
  max-width: 620px;
}

body.install-admin-page .collaborator-form-card.install-admin-container {
  width: 100%;
}

body.install-admin-page .install-admin-form .col.collaborator-form-actions {
  justify-content: stretch;
}

body.install-admin-page .install-admin-form .collaborator-form-actions .btn {
  width: 100%;
  min-width: 0;
}
