/* Gestor Ponto — baseado no estilo de referência (ponto/app/static/css.css):
   superfícies planas, linhas finas, etiquetas em contorno e cor só onde transmite informação */

:root, [data-bs-theme="light"] {
  --bg: #f6f7f9; --card: #fff; --ink: #1c2230; --muted: #6b7385; --line: #e3e6ec;
  --accent: #023364; --ok: #268d51; --bad: #c43d3d; --warn: #d69200;
  /* utilitários do Bootstrap com as mesmas cores */
  --bs-success: var(--ok); --bs-success-rgb: 38, 141, 81; --bs-danger: var(--bad); --bs-danger-rgb: 196, 61, 61;
  --bs-warning: var(--warn); --bs-warning-rgb: 214, 146, 0;
  --brand: #023364; --brand-hover: #034487;
  --theme: #023364;  /* cor do tema: barra do topo e títulos dos separadores */
  --on-theme: #fff; --on-theme-line: rgba(255, 255, 255, .3);  /* texto e linhas sobre a cor do tema */
  --on-status: #fff;  /* texto sobre o verde e o vermelho */
  --on-warn: #fff;    /* texto sobre o laranja */
  --punch-blue: var(--brand);  /* azul do botão "Terminar pausa" */
  --thead-bg: color-mix(in srgb, var(--card) 93%, #023364);  /* cabeçalho das tabelas (ligeiramente azulado) */
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 12px rgba(16, 24, 40, .08);
  --hover: color-mix(in srgb, var(--accent) 6%, transparent);
  /* cores dos tipos de ausência (calendário e resumo) */
  --k-ferias: var(--ok); --k-baixa: var(--bad); --k-falta_justificada: var(--warn); --k-falta_injustificada: #7a4bd1;
  --k-outro: #4a74d8; --k-oculto: #7d8597;

  --bs-body-font-family: system-ui, sans-serif;
  --bs-body-font-size: 15px;
  --bs-body-line-height: 1.45;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-border-radius: 8px;
  --bs-border-radius-sm: 6px;
  --bs-border-radius-lg: 10px;
  --bs-primary: #023364;
  --bs-primary-rgb: 2, 51, 100;
  --bs-link-color: var(--accent);
  --bs-link-color-rgb: 2, 51, 100;
  --bs-link-hover-color: var(--brand-hover);
  --bs-link-hover-color-rgb: 3, 68, 135;
}

[data-bs-theme="dark"] {
  --bg: #12151c; --card: #1b1f2a; --ink: #e8ebf2; --muted: #9097aa; --line: #2b3040;
  --accent: #7b95ff; --ok: #4cc27f; --bad: #ff7b7b; --warn: #f5ab3d;
  --bs-success: var(--ok); --bs-success-rgb: 76, 194, 127; --bs-danger: var(--bad); --bs-danger-rgb: 255, 123, 123;
  --bs-warning: var(--warn); --bs-warning-rgb: 245, 171, 61;
  --k-ferias: var(--ok); --k-baixa: var(--bad); --k-falta_justificada: var(--warn);
  --theme: #a9baff;
  --on-theme: #12151c; --on-theme-line: rgba(18, 21, 28, .35);
  --on-status: #000; --on-warn: #000; --punch-blue: #3556d8;
  --thead-bg: color-mix(in srgb, var(--card) 88%, #7b95ff);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 16px rgba(0, 0, 0, .35);
  --bs-secondary-bg: var(--card);
  --bs-tertiary-bg: var(--card);
  --bs-link-color-rgb: 123, 149, 255;
  --bs-link-hover-color: #a5b6ff;
  --bs-link-hover-color-rgb: 165, 182, 255;
  color-scheme: dark;
}

body { background: var(--bg); color: var(--ink); min-height: 100vh; }
a { color: var(--accent); }
/* links para a ficha de um funcionário: sem sublinhado; ficam mais claros ao passar o rato */
a[href^="/admin/employees/"]:not(.btn) { text-decoration: none; }
a[href^="/admin/employees/"]:not(.btn):hover { color: color-mix(in srgb, var(--accent) 65%, #fff); }
h1, h2, h3, h4, h5 { font-weight: 600; }
.text-muted { color: var(--muted) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.text-warning { color: var(--warn) !important; }
.text-primary { color: var(--accent) !important; }
.bg-primary { background-color: var(--brand) !important; }

/* ---- botões ---- */
.btn { --bs-btn-padding-y: 8px; --bs-btn-padding-x: 12px; --bs-btn-font-size: 15px; --bs-btn-font-weight: 400;
  --bs-btn-border-radius: 8px; box-shadow: none !important; }
.btn-sm { --bs-btn-padding-y: 4px; --bs-btn-padding-x: 8px; --bs-btn-font-size: 13px; --bs-btn-border-radius: 6px; }
.btn-primary {
  --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--brand-hover); --bs-btn-hover-border-color: var(--brand-hover); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--brand); --bs-btn-active-border-color: var(--brand);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-bg: #3556d8; --bs-btn-border-color: #3556d8;
  --bs-btn-hover-bg: #4767e6; --bs-btn-hover-border-color: #4767e6; --bs-btn-active-bg: #3556d8;
  --bs-btn-disabled-bg: #3556d8; --bs-btn-disabled-border-color: #3556d8; }
/* texto do mês/semana entre as setas: não é clicável, mas lê-se como texto normal */
.btn.period-label { --bs-btn-disabled-opacity: 1; --bs-btn-disabled-color: var(--ink); }
/* botões só com um ícone (setas, lápis): o ícone fica centrado no botão */
.btn-icon { display: inline-flex; align-items: center; justify-content: center; }
/* "ghost": fundo transparente com linha fina */
.btn-outline-primary, .btn-light, .btn-outline-secondary {
  --bs-btn-bg: transparent; --bs-btn-color: var(--ink); --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: var(--hover); --bs-btn-hover-color: var(--ink); --bs-btn-hover-border-color: var(--line);
  --bs-btn-active-bg: var(--hover); --bs-btn-active-color: var(--accent); --bs-btn-active-border-color: var(--accent);
  --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-border-color: var(--line);
}
.btn-outline-danger { --bs-btn-color: var(--bad); --bs-btn-border-color: var(--bad); --bs-btn-hover-bg: var(--bad);
  --bs-btn-hover-border-color: var(--bad); --bs-btn-active-bg: var(--bad); --bs-btn-active-border-color: var(--bad); }
.btn-outline-success { --bs-btn-color: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: var(--ok);
  --bs-btn-hover-border-color: var(--ok); --bs-btn-active-bg: var(--ok); --bs-btn-active-border-color: var(--ok); }
/* no modo escuro o verde e o vermelho são claros: nos botões com esse fundo o texto escuro tem mais contraste */
[data-bs-theme="dark"] .btn-outline-success, [data-bs-theme="dark"] .btn-outline-danger {
  --bs-btn-hover-color: #000; --bs-btn-active-color: #000; }
/* botão discreto de eliminar (contorno e ícone vermelhos): ao passar o rato fica vermelho como os outros */
.btn-light.text-danger { border-color: var(--bad); }
.btn-light.text-danger:hover, .btn-light.text-danger:focus-visible, .btn-light.text-danger:active {
  background: var(--bad); border-color: var(--bad); color: #fff !important; }
[data-bs-theme="dark"] .btn-light.text-danger:hover, [data-bs-theme="dark"] .btn-light.text-danger:focus-visible,
[data-bs-theme="dark"] .btn-light.text-danger:active { color: #000 !important; }
[data-bs-theme="dark"] .btn-success, [data-bs-theme="dark"] .btn-danger {
  --bs-btn-color: #000; --bs-btn-hover-color: #000; --bs-btn-active-color: #000; --bs-btn-disabled-color: #000; }
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok);
  --bs-btn-hover-bg: color-mix(in srgb, var(--ok) 85%, #fff); --bs-btn-hover-border-color: color-mix(in srgb, var(--ok) 85%, #fff);
  --bs-btn-active-bg: var(--ok); --bs-btn-active-border-color: var(--ok); --bs-btn-disabled-bg: var(--ok); }
.btn-danger { --bs-btn-bg: var(--bad); --bs-btn-border-color: var(--bad);
  --bs-btn-hover-bg: color-mix(in srgb, var(--bad) 85%, #fff); --bs-btn-hover-border-color: color-mix(in srgb, var(--bad) 85%, #fff);
  --bs-btn-active-bg: var(--bad); --bs-btn-active-border-color: var(--bad); --bs-btn-disabled-bg: var(--bad); }
.btn-warning { --bs-btn-bg: var(--warn); --bs-btn-border-color: var(--warn); --bs-btn-color: var(--on-warn);
  --bs-btn-hover-bg: color-mix(in srgb, var(--warn) 85%, #fff); --bs-btn-hover-border-color: color-mix(in srgb, var(--warn) 85%, #fff);
  --bs-btn-hover-color: var(--on-warn); --bs-btn-active-color: var(--on-warn); --bs-btn-disabled-color: var(--on-warn); --bs-btn-active-bg: var(--warn); --bs-btn-active-border-color: var(--warn);
  --bs-btn-disabled-bg: var(--warn); }
/* o botão selecionado fica por cima dos vizinhos, para o hover destes não tapar a sua borda */
.btn-group > .btn.active, .btn-group > .btn-check:checked + .btn { color: var(--accent); border-color: var(--accent); z-index: 2; }

/* ---- formulários ---- */
.form-control, .form-select { padding: 8px 10px; font-size: 15px; border: 1px solid var(--line); border-radius: 8px;
  background-color: var(--bg); color: var(--ink); }
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm { padding: 4px 8px; font-size: 13px; }
.form-select.form-select-sm { padding-right: 2rem; }
.form-control:focus, .form-select:focus { border-color: var(--accent); box-shadow: none; background-color: var(--bg); }
/* botão "Escolher ficheiros" dos campos de ficheiro, com hover nos dois temas */
.form-control::file-selector-button { background-color: color-mix(in srgb, var(--accent) 8%, var(--card)); color: var(--ink);
  transition: background-color .15s ease-in-out; }
.form-control:hover:not(:disabled):not([readonly])::file-selector-button {
  background-color: color-mix(in srgb, var(--accent) 20%, var(--card)); }
.form-label { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.form-check-input { background-color: var(--bg); border-color: var(--line); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-text { color: var(--muted); }
.form-range { --bs-secondary-bg: var(--line); }
.form-range::-webkit-slider-thumb { background-color: var(--accent); }
.form-range::-moz-range-thumb { background-color: var(--accent); }

/* ---- etiquetas (tag): contorno colorido, sem fundo ---- */
.badge { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 22px; height: 22px;
  font-size: 12px; font-weight: 600; line-height: 1; padding: 0 7px; border-radius: 99px; border: 1px solid var(--line);
  background: transparent !important; color: var(--muted) !important; vertical-align: middle; }
.badge.text-bg-success { color: var(--ok) !important; border-color: var(--ok); }
.badge.text-bg-danger { color: var(--bad) !important; border-color: var(--bad); }
.badge.text-bg-warning { color: var(--warn) !important; border-color: var(--warn); }
.badge.text-bg-primary, .badge.text-bg-info { color: var(--accent) !important; border-color: var(--accent); }
button.badge { cursor: pointer; transition: background-color .15s ease-in-out; }
button.badge:hover { background: color-mix(in srgb, currentColor 14%, transparent) !important; }
/* contador do sino: pequeno círculo vermelho sólido */
#notifBadge { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; border: 0;
  background: var(--bad) !important; color: #fff !important; }

/* ---- barra do topo (mantém o azul do tema) ---- */
.gp-topbar { background: var(--theme); color: var(--on-theme); height: 52px; position: sticky; top: 0; z-index: 1030; }
.gp-topbar > a, .gp-topbar > .btn-link, .gp-topbar .ms-auto > a, .gp-topbar .gp-user { color: var(--on-theme); text-decoration: none; }
.gp-brand { font-size: 18px !important; font-weight: 600; }
.gp-company { font-size: 15px; opacity: .8; border-color: var(--on-theme-line) !important; }
.gp-user { font-size: 15px; }
.gp-user-name { opacity: .8; }  /* mesmo tom que o nome da empresa */
/* botões quadrados da barra (tema, notificações, menu da conta): todos com as mesmas dimensões */
.topbar-btn, .theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 8px; border: 0; background: transparent; color: var(--ink); padding: 0;
  transition: background-color .15s ease-in-out; }
.gp-topbar .theme-toggle, .gp-topbar .topbar-btn { color: var(--on-theme); }
.gp-topbar .btn-outline-light { --bs-btn-color: var(--on-theme); --bs-btn-border-color: var(--on-theme-line);
  --bs-btn-hover-color: var(--on-theme); --bs-btn-hover-bg: rgba(127, 127, 127, .15); --bs-btn-hover-border-color: var(--on-theme-line); }
.theme-toggle:hover, a.topbar-btn:hover, button.topbar-btn:hover, .topbar-btn[aria-expanded="true"],
.gp-user:hover .topbar-btn { background: rgba(127, 127, 127, .15); }
.gp-topbar .theme-toggle:hover, .gp-topbar button.topbar-btn:hover, .gp-topbar .topbar-btn[aria-expanded="true"],
.gp-topbar .gp-user:hover .topbar-btn { background: color-mix(in srgb, var(--on-theme) 16%, transparent); }
.topbar-btn .bi { font-size: 16px; line-height: 1; }
.topbar-btn #notifBadge { top: 2px !important; }
.theme-toggle .icon-sun, [data-bs-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-bs-theme="dark"] .theme-toggle .icon-sun { display: block; }
.theme-toggle-float { position: fixed; top: 16px; right: 16px; z-index: 10; }

/* ---- menus e janelas ---- */
.dropdown-menu { --bs-dropdown-bg: var(--card); --bs-dropdown-border-color: var(--line); --bs-dropdown-border-radius: 12px;
  --bs-dropdown-link-color: var(--ink); --bs-dropdown-link-hover-color: var(--ink); --bs-dropdown-link-hover-bg: var(--hover);
  --bs-dropdown-link-active-bg: var(--hover); --bs-dropdown-link-active-color: var(--accent);
  --bs-dropdown-divider-bg: var(--line); --bs-dropdown-font-size: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .25); padding: 6px; }
.dropdown-item { border-radius: 6px; padding: 6px 10px; }
.gp-topbar .dropdown-menu .dropdown-item { color: var(--ink); }
.modal { --bs-modal-bg: var(--card); --bs-modal-border-color: var(--line); --bs-modal-border-radius: 12px;
  --bs-modal-header-border-color: var(--line); --bs-modal-footer-border-color: var(--line); --bs-modal-padding: 20px; }
.modal-backdrop { --bs-backdrop-opacity: .4; }
.modal-title { font-size: 16px; font-weight: 600; }
.alert { border-radius: 10px; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.alert-success { border-color: var(--ok); } .alert-danger { border-color: var(--bad); }
.alert-warning { border-color: var(--warn); } .alert-info { border-color: var(--accent); }
.alert-success b, .alert-danger b, .alert-warning b { color: inherit; }
.offcanvas { --bs-offcanvas-bg: var(--card); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--line); --bs-list-group-color: var(--ink);
  --bs-list-group-action-color: var(--ink); --bs-list-group-action-hover-color: var(--ink);
  --bs-list-group-action-hover-bg: color-mix(in srgb, var(--accent) 10%, transparent);
  --bs-list-group-action-active-color: var(--ink);
  --bs-list-group-action-active-bg: color-mix(in srgb, var(--accent) 16%, transparent); }
.pagination { --bs-pagination-bg: transparent; --bs-pagination-border-color: var(--line); --bs-pagination-color: var(--ink);
  --bs-pagination-hover-bg: var(--hover); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); }

/* ---- separadores (sublinhado) ---- */
.gp-tabs { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 52px; z-index: 1020;
  padding: 0 16px; }
.gp-tabs .nav { gap: 4px !important; }
.gp-tabs .nav-link, .gp-tabs .nav-link.active, .gp-tabs .nav-link.dropdown-toggle.active { background: transparent;
  color: var(--muted); padding: 12px 10px 10px; border-radius: 0; border-bottom: 2px solid transparent; }
.gp-tabs .nav-link:hover { color: var(--ink); }
.gp-tabs .nav-link.active, .gp-tabs .nav-link.dropdown-toggle.active { color: var(--ink); border-bottom-color: var(--accent); }
.gp-tabs .nav-link .bi { display: none; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--brand); }

/* ---- estrutura ---- */
.gp-sidebar { width: 230px; background: var(--card); border-right: 1px solid var(--line); min-height: calc(100vh - 52px);
  position: sticky; top: 52px; align-self: flex-start; }
.gp-sidebar .nav-link { color: var(--muted); border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.gp-sidebar .nav-link:hover, .gp-sidebar .nav-link.active { background: var(--hover); color: var(--ink); }
.gp-sidebar .nav-section { font-size: 12px; color: var(--muted); padding: 14px 10px 4px; }
.gp-main { flex: 1; min-width: 0; padding: 20px 16px 60px; }
.pane { transition: opacity .15s; }
.pane.loading { opacity: .45; pointer-events: none; }

/* ---- cartões ---- */
.card { --bs-card-bg: var(--card); --bs-card-border-color: var(--line); --bs-card-border-radius: 10px;
  --bs-card-inner-border-radius: 9px; --bs-card-spacer-y: 16px; --bs-card-spacer-x: 16px; --bs-card-cap-padding-y: 12px;
  --bs-card-cap-padding-x: 16px; box-shadow: var(--shadow); }
.card-header { background: transparent; border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 600; }
.page-title { font-size: 18px; font-weight: 600; color: var(--ink); }
/* títulos dos separadores: maiores e alinhados com a margem esquerda dos cartões */
.gp-main .page-title { font-size: 26px; color: var(--theme); }
.auth-card .page-title { font-size: 24px; }
.empty { color: var(--muted); text-align: center; padding: 18px 14px; }

/* indicadores */
.stat .card-body { padding: 12px 14px; }
.stat .label { color: var(--muted); font-size: 13px; }
.stat .value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
/* cards do painel com fundo na cor do estado; o texto segue o contraste de cada tema */
.stat-ok, .stat-warn, .stat-bad { --bs-card-bg: var(--stat-color); --bs-card-color: var(--stat-text); color: var(--stat-text);
  --bs-card-border-color: color-mix(in srgb, var(--stat-color) 60%, #fff); }  /* no claro, a borda é mais clara */
[data-bs-theme="dark"] :is(.stat-ok, .stat-warn, .stat-bad) {
  --bs-card-border-color: color-mix(in srgb, var(--stat-color) 70%, #000); }  /* no escuro, mais escura */
.stat-ok { --stat-color: var(--ok); --stat-text: var(--on-status); }
.stat-warn { --stat-color: var(--warn); --stat-text: var(--on-warn); }.stat-bad { --stat-color: var(--bad); --stat-text: var(--on-status); }
.stat-ok .label, .stat-warn .label, .stat-bad .label { color: inherit; }

/* ---- picagem ---- */
.clock { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 14px; }
.punch-btn { --bs-btn-font-weight: 600; font-size: 18px; padding: 14px 34px; border-radius: 12px; min-width: 0; }
/* no modo escuro o amarelo também é claro: texto preto (o verde e o vermelho já o têm em todos os botões) */
[data-bs-theme="dark"] .punch-btn.btn-warning {
  --bs-btn-color: #000; --bs-btn-hover-color: #000; --bs-btn-active-color: #000; --bs-btn-disabled-color: #000; }
.state-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.state-working { color: var(--ok); } .state-break { color: var(--warn); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.state-working .dot { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3 } }
.timeline { list-style: none; padding-left: 0; margin: 0; }
.timeline li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline li:first-child { padding-top: 0; }
.timeline li:last-child { border-bottom: 0; padding-bottom: 0; }
/* cores de cada tipo de registo, as mesmas dos botões de picagem: --kc é a cor, --kt o texto por cima dela */
.k-in { --kc: var(--ok); --kt: var(--on-status); } .k-out { --kc: var(--bad); --kt: var(--on-status); }
.k-break_start { --kc: var(--warn); --kt: var(--on-warn); } .k-break_end { --kc: var(--punch-blue); --kt: #fff; }
.tl-icon { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0; background: var(--kc); color: var(--kt); }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--kc); }
.kbadge { font-size: 12px; padding: 2px 7px; border-radius: 99px; color: #fff; white-space: nowrap; }

/* ---- tabelas ---- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--ink); --bs-table-hover-bg: var(--hover);
  --bs-table-hover-color: var(--ink); --bs-border-color: var(--line); }
.table > :not(caption) > * > * { padding: 8px 6px; }
.table > :not(caption) > * > *:first-child { padding-left: 16px; }
.table > :not(caption) > * > *:last-child { padding-right: 16px; }
/* cabeçalho das tabelas num tom um pouco mais escuro (claro) ou mais claro (escuro) que o cartão, para se destacar */
.table thead th { background: var(--thead-bg); color: var(--ink); font-weight: 500; font-size: 13px; white-space: nowrap;
  border-bottom: 1px solid var(--line); }
.table thead th .text-muted { color: inherit !important; opacity: .8; }
/* os cantos do cabeçalho seguem os cantos arredondados do cartão */
.card:has(> .table-responsive), .card:has(> .table) { overflow: hidden; }
.table-days td, .table-days th { vertical-align: middle; font-size: 14px; }
tr.st-rest td, tr.st-holiday td { background: color-mix(in srgb, var(--muted) 8%, transparent); color: var(--muted); }
tr.st-future td { color: var(--muted); }
tr.st-absence td:first-child { box-shadow: inset 3px 0 var(--k-ferias); }
tr.st-falta td:first-child { box-shadow: inset 3px 0 var(--bad); }
tr.st-open td:first-child { box-shadow: inset 3px 0 var(--warn); }
.pos { color: var(--ok); } .neg { color: var(--bad); }
/* ponto verde "entrada em aberto" ao lado das horas, sem descentrar o texto */
.open-mark { position: relative; }
.open-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); vertical-align: middle; }
.open-mark .open-dot { position: absolute; left: 100%; top: 50%; margin-left: 6px; transform: translateY(-50%); }
.punch-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 99px;
  padding: 2px 3px 2px 10px; margin: 2px; font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.punch-chip > .bi:first-child { margin-right: 2px; }
/* registos com a cor do tipo (borda, fundo suave e ícone); fora do local: borda tracejada e texto vermelho */
.punch-chip[class*="k-"] { border-color: var(--kc); background: color-mix(in srgb, var(--kc) 14%, transparent); }
.punch-chip[class*="k-"] > .bi:first-child { color: var(--kc); }
.punch-chip.outside { border-style: dashed; color: var(--bad); }
.punch-chip.deleted { text-decoration: line-through; opacity: .5; }
.punch-chip button { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
  border: 0; border-radius: 50%; background: none; padding: 0; color: var(--accent); font-size: 15px; line-height: 1; }
.punch-chip button:hover { background: var(--hover); }
.punch-chip:not(:has(button)) { padding-right: 10px; min-height: 34px; }
.punch-chip .edited { width: 10px; height: 10px; opacity: .6; vertical-align: super; }
/* tabela do admin: cada registo é um botão para o corrigir e cada dia é clicável para adicionar um registo */
.punch-chip[data-edit-punch], .punch-chip[data-review] { cursor: pointer;
  transition: background-color .15s ease-in-out, border-color .15s ease-in-out; }
.punch-chip[data-edit-punch]:hover, .punch-chip[data-edit-punch]:focus-visible,
.punch-chip[data-review]:hover, .punch-chip[data-review]:focus-visible {
  background: color-mix(in srgb, var(--kc, var(--accent)) 32%, transparent); outline: 0; }
.table-days tr[data-add-date] { cursor: pointer; }
/* registo com um pedido de correção por tratar: ponto laranja com o centro sobre a borda, na curva do canto
   superior direito (a 45 graus, ~5 px do canto exterior); pedido para adicionar: tracejado, sem fundo */
.punch-chip.pending { position: relative; }
.punch-chip.pending::after { content: ''; position: absolute; top: -2.5px; right: -2.5px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--warn); border: 2px solid var(--card); }
.punch-chip.ghost { border-style: dashed; background: transparent; }
/* cada registo tem à volta uma margem contígua à dos vizinhos: sobre ela (os espaços entre registos) a linha não reage,
   para não piscar ao passar de um registo para outro; a zona vazia a seguir ao último registo continua a reagir */
.punch-chips { display: flex; flex-wrap: wrap; }
.chip-cell { display: inline-flex; padding: 2px; cursor: default; position: relative; }
.chip-cell .punch-chip { margin: 0; position: relative; z-index: 1; }
/* a margem de cada registo vai até ao topo e ao fundo da célula (cortada pela célula e por baixo dos registos vizinhos) */
.chips-td { overflow: hidden; }
.chip-cell::before, .chip-cell::after { content: ''; position: absolute; left: 0; right: 0; height: 200px; z-index: 0; }
.chip-cell::before { bottom: 100%; }
.chip-cell::after { top: 100%; }
/* zona vazia a seguir ao último registo: fica por cima dessas margens e continua a reagir como o resto da linha */
.chip-fill { flex: 1 1 0; position: relative; z-index: 1; }
.chip-fill::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 200px; }
.table-days tr[data-add-date]:hover:not(:has(.chip-cell:hover)) td { background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* botão só com ícone (ex.: PDF/Excel nas tabelas) */
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border-radius: 8px; border: 1px solid var(--line); color: var(--accent); font-size: 16px; text-decoration: none; }
.icon-btn:hover { background: var(--hover); border-color: var(--accent); color: var(--accent); }

/* ---- funcionários ---- */
/* clicar na linha seleciona o funcionário (no cabeçalho, todos os visíveis) */
#empTable tr.sel-row, #empTable tr.sel-head { cursor: pointer; }
#empTable tr.selected > td { background: color-mix(in srgb, var(--accent) 8%, transparent); }

/* linhas que abrem uma página (ex.: pedido de correção -> mês do funcionário) */
tr[data-href] { cursor: pointer; }
tr[data-href]:hover > td { background: var(--hover); }

/* link discreto no cabeçalho de um cartão (ex.: "Ver mês", "Relatórios") */
.header-link { text-decoration: none; padding: 2px 8px; margin: -2px -8px -2px 0; border-radius: 6px;
  transition: background-color .15s ease-in-out; }
.header-link:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.week-search { width: 220px; }

/* painel: com muitos funcionários, as listas e a tabela de horas ficam com altura limitada e scroll próprio */
.card-scroll { max-height: 372px; overflow-y: auto; }
/* tabelas de números (ex.: relatórios): tudo ao centro menos a primeira coluna (o nome) */
.cols-center :is(th, td):not(:first-child) { text-align: center; }
.table-scroll { max-height: 560px; overflow-y: auto; }
.table-scroll thead th { position: sticky; top: 0; z-index: 2; }

/* janela de decisão de um pedido */
.review-change { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }
.review-change .punch-chip { padding-right: 10px; min-height: 30px; }
.review-arrow { color: var(--muted); align-self: flex-end; padding-bottom: 6px; }
.punch-chip.deleted-req { color: var(--bad); border-color: var(--bad); text-decoration: line-through; }
.review-info { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin-bottom: 14px; }
.review-info dt { font-weight: 500; color: var(--muted); }
.review-info dd { margin: 0; overflow-wrap: anywhere; }
.bulk-bar { position: sticky; top: 104px; z-index: 5; background: var(--card); border: 1px solid var(--accent);
  border-radius: 10px; }
.bulk-bar .text-white { color: var(--muted) !important; }
.bulk-bar .form-select { min-width: 160px; }

/* ---- mapas ---- */
#map, .map { height: 380px; border-radius: 8px; border: 1px solid var(--line); }
.map-modal { height: 420px; border-radius: 8px; }
.corr-map { flex: 1; min-height: 260px; border-radius: 8px; border: 1px solid var(--line); }
.loc-pin { width: 18px; height: 18px; border-radius: 50%; background: #0d6efd; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35); cursor: move; }

/* ---- calendário ---- */
.fc { --fc-border-color: var(--line); --fc-page-bg-color: var(--card); --fc-neutral-bg-color: var(--bg);
  --fc-list-event-hover-bg-color: var(--hover); --fc-today-bg-color: color-mix(in srgb, var(--accent) 4%, transparent);
  --fc-button-bg-color: transparent; --fc-button-border-color: var(--line); --fc-button-text-color: var(--ink);
  --fc-button-hover-bg-color: var(--hover); --fc-button-hover-border-color: var(--line);
  --fc-button-active-bg-color: transparent; --fc-button-active-border-color: var(--accent); font-size: 14px; }
.fc .fc-button { font-size: 14px; padding: 6px 10px; border-radius: 8px; box-shadow: none !important; }
/* setas antes e depois do mês, na mesma linha, com o ícone centrado no botão */
.fc .fc-header-toolbar .fc-toolbar-chunk { display: flex; align-items: center; gap: 8px; }
.fc .fc-header-toolbar .fc-toolbar-chunk > * { margin: 0 !important; }
.fc .fc-prev-button, .fc .fc-next-button { display: inline-flex; align-items: center; justify-content: center; }
/* largura fixa do título, para as setas não mudarem de lugar ao trocar de mês ou de semana */
.fc .fc-header-toolbar .fc-toolbar-title { width: 290px; max-width: 50vw; text-align: center; }
/* horário na vista Semana: trabalho e pausa como fundo */
.fc .fc-bg-event.sched-work, .fc .fc-bg-event.sched-break { opacity: 1; }
.fc .fc-bg-event .fc-event-title { font-style: normal; font-size: 12px; color: var(--ink); }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: var(--accent); }
/* o botão ativo fica por cima dos vizinhos, para o hover destes não tapar a sua borda */
.fc .fc-button-group > .fc-button.fc-button-active { z-index: 2; }
.fc-toolbar-title { font-size: 20px !important; font-weight: 600; }
.fc .fc-daygrid-day-number, .fc .fc-col-header-cell-cushion, .fc .fc-list-day-cushion a { color: inherit; text-decoration: none; }
.fc .fc-col-header-cell { background: var(--thead-bg); }
.fc .fc-col-header-cell-cushion { color: var(--ink); font-weight: 500; font-size: 13px; }
.cal-clickable .fc-daygrid-day, .cal-clickable .fc-timegrid-col { cursor: pointer; }
.cal-clickable .fc-daygrid-day:hover, .cal-clickable .fc-timegrid-col:hover,
.cal-clickable .fc-daygrid-day.fc-day-today:hover, .cal-clickable .fc-timegrid-col.fc-day-today:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ev-pending { opacity: .6; border-style: dashed !important; }
/* "hoje" ao lado do número do dia atual (a linha do dia é row-reverse: ::after fica à esquerda do número) */
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-top { align-items: baseline; }  /* "hoje" na mesma linha do número */
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-top::after { content: 'hoje'; margin-right: 2px;
  font-size: 12px; color: var(--muted); }
/* indicador de carregamento */
.fc .fc-view-harness { position: relative; }
#cal.is-loading .fc-list-empty { visibility: hidden; }
#cal.is-loading .fc-view-harness::after { content: ''; position: absolute; top: 50%; left: 50%; width: 28px; height: 28px;
  margin: -14px 0 0 -14px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent);
  animation: gp-spin .8s linear infinite; z-index: 5; }
@keyframes gp-spin { to { transform: rotate(360deg); } }
.legend-items { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; }
.leg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.kdot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

/* ---- login ---- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; }

/* ---- notificações ---- */
/* barra de destaque reta (sem acompanhar os cantos arredondados do cartão) */
.notif-unread { position: relative; }
.list-group-item.notif-unread::after { content: ''; position: absolute; left: 0;
  top: 0; bottom: 0; width: 3px; background: var(--accent); }
.list-group-item.notif-read { background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--muted); }
.notif-read b { font-weight: 500; }
.notif-read .small { opacity: .75; }
.notif-link { cursor: pointer; }
.list-group-item.notif-link:hover, .list-group-item.msg-item:hover, .notif-item.notif-link:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent); }
.notif-note { display: inline-flex; align-items: center; font-size: 12px; padding: 2px 7px; margin-top: 4px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted); }
.notif-note.cancelled { color: var(--bad); border-color: var(--bad); }
.n-check { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  padding: 0; border-radius: 8px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.n-check:hover { color: var(--ok); border-color: var(--ok); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13px; cursor: pointer; }
.linkbtn:hover { text-decoration: underline; }

/* lista do sino */
.notif-menu { width: min(400px, calc(100vw - 24px)); padding: 0 !important; overflow: hidden; color: var(--ink); }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-list { max-height: min(60vh, 480px); overflow-y: auto; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--line);
  position: relative; }
.notif-item:last-child { border-bottom: 0; }
.notif-item.unread::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.notif-item.read { background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--muted); }
.notif-item.read b { font-weight: 500; }
.notif-item .n-main { flex: 1; min-width: 0; }
.notif-item .n-body { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.notif-item .n-time { color: var(--muted); font-size: 12px; margin-top: 4px; }
.notif-item .empty, .notif-list .empty { padding: 18px 14px; }
.notif-foot { display: block; text-align: center; padding: 10px; border-top: 1px solid var(--line); font-size: 14px;
  color: var(--accent) !important; }
.notif-foot:hover { background: var(--hover); }
#confirmModal { z-index: 1065; }

/* ---- comunicações ---- */
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.list-group-item.msg-unread { position: relative; }
.list-group-item.msg-unread::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); }
.list-group-item.msg-unread b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; vertical-align: 1px; }
.list-group-item.msg-read { background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--muted); }
.msg-read b { font-weight: 500; }
/* barra verde à esquerda: mensagem enviada que todos já leram */
.list-group-item.msg-allread::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--ok); }
.msg-rich { white-space: normal; }
.msg-rich ul, .msg-rich ol { margin: 4px 0; padding-left: 24px; }
.msg-rich p { margin: 0; }
.msg-editor-wrap { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; }
.msg-editor-wrap:focus-within { border-color: var(--accent); }
.msg-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--line); }
.msg-tool { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: var(--muted);
  transition: background-color .15s ease-in-out, color .15s ease-in-out; }
.msg-tool:hover { background: var(--hover); color: var(--ink); }
.msg-tool.active { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.msg-tool-sep { width: 1px; margin: 4px; background: var(--line); }
.msg-size { width: auto; height: 30px; padding: 2px 36px 2px 8px; font-size: 13px; border: 0; color: var(--ink); }
.msg-size, .msg-size:focus { background-color: transparent; }
.msg-size:hover { background-color: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.msg-size option { background-color: var(--card); color: var(--ink); }
.msg-file-x { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border: 0;
  border-radius: 50%; background: transparent; color: var(--muted); transition: background-color .15s ease-in-out, color .15s ease-in-out; }
.msg-file-x:hover { background: var(--hover); color: var(--bad); }
.msg-editor { min-height: 170px; max-height: 420px; overflow-y: auto; padding: 8px 10px; outline: 0; overflow-wrap: anywhere; }
.msg-editor:empty::before { content: attr(data-placeholder); color: var(--muted); pointer-events: none; }
.msg-files { display: flex; flex-wrap: wrap; gap: 8px; }
.msg-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); font-size: 14px; text-decoration: none; transition: background-color .15s ease-in-out, border-color .15s ease-in-out; }
.msg-file:hover { background: var(--hover); border-color: var(--accent); color: var(--ink); }
.msg-file svg { flex-shrink: 0; color: var(--bad); }
.msg-file .msg-file-ok { display: none; color: var(--ok); }
.msg-file.opened .msg-file-ok { display: inline-block; }
.count-num { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; margin-right: 8px; }
.read-bar { width: 90px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; flex-shrink: 0; }
.read-bar span { display: block; height: 100%; background: var(--ok); }
.pick-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.pick-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; margin: 0; cursor: pointer;
  border-bottom: 1px solid var(--line); }
.pick-row:last-child { border-bottom: 0; }
.pick-row:hover { background: var(--hover); }
.pick-row .form-check-input { margin: 0; flex-shrink: 0; }
.pick-all { color: var(--muted); font-size: 13px; }
