/* Copyright (c) 2026 Kengi Sueto / Kaizen Solutions Technology (KST). Todos os direitos reservados.
   SOFTWARE PROPRIETARIO E CONFIDENCIAL - uso restrito a pessoas autorizadas pela KST.
   Proibida copia, distribuicao, obra derivada ou uso em produto concorrente. Ver LICENSE. */
/* ============================================================
   Kaizen V2 - Sistema de design do painel
   Foco: clareza operacional para usuários nao-tecnicos.
   ============================================================ */
:root{
  --bg:#f8fafc; --card:#fff; --ink:#0f172a; --muted:#64748b; --line:#e2e8f0;
  --soft:#f1f5f9; --soft-2:#e2e8f0; --sidebar:#111827; --sidebar-text:#cbd5e1;
  --accent:#0ea5e9; --accent-hover:#0284c7; --accent-soft:#e0f2fe;
  --green:#22c55e; --green-soft:#dcfce7;
  --paid-leave:#7c3aed; --paid-leave-soft:#ede9fe;
  --amber:#f59e0b; --amber-soft:#fef3c7;
  --red:#ef4444; --red-soft:#fee2e2;
  --shift-day:#f59e0b; --shift-day-soft:#fef3c7; --shift-day-text:#92400e;
  --shift-night:#0ea5e9; --shift-night-soft:#e0f2fe; --shift-night-text:#0369a1;
  --navy:var(--ink); --navy-2:#334155; --navy-3:var(--sidebar);
  --cyan:var(--accent); --cyan-d:var(--accent-hover);
  --shadow:0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.08);
}
*{ margin:0; padding:0; box-sizing:border-box; }
/* A pilha cobre latim E japones: 1.132 dos 1.143 rotulos tem kanji ou kana.
   "Segoe UI" nao tem glifo CJK, entao na pilha antiga todo japones caia no
   `sans-serif` generico — que varia por dispositivo e sai com tamanho optico
   diferente do latim ao lado, na mesma linha.
   O navegador escolhe fonte POR GLIFO: latinas primeiro, japonesas em seguida,
   cobrindo Windows (Yu Gothic), Apple (Hiragino) e Android (Noto). */
body{ font-family:system-ui,-apple-system,"Segoe UI",Roboto,
      "Hiragino Kaku Gothic ProN","Hiragino Sans","Yu Gothic UI","Yu Gothic",
      "Noto Sans JP","Noto Sans CJK JP",Meiryo,sans-serif; color:var(--ink);
      background:var(--bg); font-size:14px; line-height:1.5; }
a{ text-decoration:none; color:inherit; }

/* Entidade clicavel dentro de lista.
   A tabela tem ate quatro links por linha; pintar todos de azul viraria um mar.
   Sublinhado discreto no repouso ja informa que ha destino, e firma no hover.
   O foco tem contorno proprio: quem navega por teclado precisa ver onde esta. */
.link-entidade{
  color:inherit;
  text-decoration:underline;
  text-decoration-color:color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset:3px;
  text-decoration-thickness:1px;
  border-radius:3px;
}
.link-entidade:hover{
  color:var(--accent-hover);
  text-decoration-color:currentColor;
}
.link-entidade:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
  text-decoration-color:currentColor;
}
html[data-theme="dark"] .link-entidade:hover{ color:var(--accent); }
h1,h2,h3{ color:var(--ink); }

/* layout */
.app{ display:grid; grid-template-columns:264px minmax(0,1fr); min-height:100vh; }
.sidebar{ background:var(--sidebar); color:var(--sidebar-text); display:flex; flex-direction:column; }
.brand{ padding:18px 18px 16px; border-bottom:1px solid rgba(255,255,255,.08);
        display:flex; align-items:center; gap:12px; min-height:78px; }
.brand img{ width:38px; height:38px; border-radius:50%; object-fit:cover; border:1px solid rgba(255,255,255,.14); }
.brand-copy{ min-width:0; }
.brand-name{ font-size:21px; font-weight:900; letter-spacing:.7px; line-height:1; color:#f8fafc; }
.brand .c{ color:var(--accent); }
.brand small{ display:block; font-size:11px; font-weight:600; color:#94a3b8; letter-spacing:.3px; margin-top:5px; line-height:1.25; }
.nav{ padding:14px 12px; display:flex; flex-direction:column; gap:3px; flex:1; }
.nav a{ display:flex; align-items:center; gap:11px; min-width:0; padding:9px 13px; border-radius:8px;
        color:#cbd5e1; font-weight:600; font-size:14px; overflow-wrap:anywhere; }
.nav a .ic{ font-size:17px; width:20px; text-align:center; }
.nav a:hover{ background:rgba(255,255,255,.07); color:#f8fafc; }
.nav a.active{ background:rgba(14,165,233,.16); color:#fff; box-shadow:inset 3px 0 0 var(--accent); }
.nav .sep{ font-size:10.5px; text-transform:uppercase; letter-spacing:1.4px; color:#94a3b8;
           padding:14px 14px 5px; }
.nav .sep.first{ padding-top:2px; }
.sidebar .foot{ padding:14px 18px; font-size:11.5px; color:#94a3b8; border-top:1px solid rgba(255,255,255,.08); }

.main{ display:flex; flex-direction:column; min-width:0; }
.topbar{ min-height:74px; background:var(--card); border-bottom:1px solid var(--line);
         display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; padding:0 30px; gap:18px; }
.topbar-title{ min-width:0; }
.topbar-title span{ display:block; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:1.5px; text-transform:uppercase; margin-bottom:2px; }
.topbar h1{ font-size:22px; font-weight:850; line-height:1.15; }
.usermenu{ display:flex; align-items:center; flex-wrap:wrap; min-width:0; max-width:100%; gap:10px; }
.avatar{ width:34px; height:34px; border-radius:50%; background:var(--accent); color:#fff;
         display:flex; align-items:center; justify-content:center; font-weight:700; }
.usermenu .nome{ font-weight:600; font-size:13.5px; } .usermenu .papel{ font-size:11.5px; color:var(--muted); }
/* margin-inline:auto centraliza no espaco sobrando: sem isso o conteudo trava
   em max-width e fica colado a esquerda, deixando um vazio grande a direita
   em telas largas. O limite de largura fica de proposito — linha longa demais
   atrapalha a leitura e espalha as colunas das tabelas de ponto. */
.content{ padding:24px 30px 34px; max-width:1560px; width:100%; min-width:0; margin-inline:auto; }

/* cards / stats */
.cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:14px; margin-bottom:20px; }
.card{ min-width:0; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:16px; box-shadow:var(--shadow); }
.stat .lbl{ font-size:12.5px; color:var(--muted); text-transform:uppercase; letter-spacing:.5px; }
.stat .val{ font-size:29px; font-weight:850; color:var(--navy); margin-top:4px; }
.stat .ic{ float:right; font-size:24px; opacity:.85; }
.panel{ min-width:0; background:var(--card); border:1px solid var(--line); border-radius:8px; box-shadow:var(--shadow); margin-bottom:20px; overflow:hidden; }
.panel-h{ padding:15px 18px; border-bottom:1px solid var(--line); display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.panel-h h2,.panel-title{ font-size:16px; font-weight:800; color:var(--ink); } .panel-b{ min-width:0; padding:18px; }
.page-intro{ margin-bottom:16px; display:flex; align-items:flex-end; justify-content:space-between; gap:16px; }
.page-intro h2{ font-size:20px; line-height:1.2; margin-bottom:5px; }
.page-intro .desc{ color:var(--muted); font-size:13.5px; max-width:760px; }
.page-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
.section-title{ font-size:16px; font-weight:800; color:var(--ink); }
.dashboard-grid{ display:grid; grid-template-columns:minmax(0,1.65fr) minmax(340px,.85fr); gap:20px; align-items:start; }
.dashboard-grid > *{ min-width:0; }

/* buttons */
.btn{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--line); background:var(--card);
      color:var(--ink); padding:8px 14px; border-radius:8px; font-size:13.5px; font-weight:600; cursor:pointer; }
.btn:hover{ border-color:#cbd5e1; background:var(--soft); }
.btn-primary{ background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-primary:hover{ background:var(--accent-hover); border-color:var(--accent-hover); }
.btn-danger{ background:var(--red); border-color:var(--red); color:#fff; }
.btn-sm{ padding:5px 10px; font-size:12.5px; }
.btn-ghost{ background:transparent; border-color:transparent; color:var(--muted); }

/* tables */
.table-wrap{ width:100%; max-width:100%; overflow-x:auto; overscroll-behavior-inline:contain; -webkit-overflow-scrolling:touch; }
.tbl,.table-wrap table{ width:100%; border-collapse:collapse; font-size:13.5px; }
.table-wrap > table{ min-width:680px; }
.tbl th,.table-wrap th{ background:var(--soft); color:var(--ink); text-align:left; padding:11px 14px; font-weight:800; font-size:12px; border-bottom:1px solid var(--line); }
.tbl td,.table-wrap td{ padding:11px 14px; border-bottom:1px solid var(--line); vertical-align:middle; }
.tbl tbody tr:hover,.table-wrap tbody tr:hover{ background:#f8fafc; }
.tbl tbody tr:last-child td,.table-wrap tbody tr:last-child td{ border-bottom:0; }
.tbl .chk{ width:38px; text-align:center; }
.muted{ color:var(--muted); } .right{ text-align:right; } .center{ text-align:center; }
.cell-strong{ font-weight:800; color:var(--ink); }
.text-warn{ color:var(--amber); }
.text-danger{ color:var(--red); }
.row-actions{ display:flex; align-items:center; justify-content:center; gap:6px; flex-wrap:wrap; }

/* badges */
.badge{ display:inline-block; padding:3px 9px; border-radius:999px; font-size:11.5px; font-weight:800; white-space:nowrap; }
.badge.ok{ background:var(--green-soft); color:#15803d; }
.badge.warn{ background:var(--amber-soft); color:#92400e; }
.badge.danger{ background:var(--red-soft); color:#b91c1c; }
.badge.info{ background:var(--accent-soft); color:#0369a1; }
.badge.neutral{ background:var(--soft); color:#475569; }
.dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }

/* filters / toolbar */
.toolbar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:16px; }
.input,.select{ border:1px solid var(--line); border-radius:8px; padding:8px 12px; font-size:13.5px; background:var(--card); color:var(--ink); }
.input:focus,.select:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(14,165,233,.14); }
.visually-hidden{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); clip-path:inset(50%); white-space:nowrap; border:0;
}
.file-picker{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:6px; }
.file-picker-button{ flex:0 0 auto; }
.file-picker-name{ min-width:0; color:var(--muted); font-size:12.5px; font-weight:500; overflow-wrap:anywhere; }
.file-picker-input:focus-visible + .file-picker-button{
  outline:3px solid rgba(14,165,233,.28); outline-offset:2px; border-color:var(--accent);
}
.select-sm{ padding:6px 10px; font-size:12.5px; max-width:210px; }
.tenant-switch{ display:flex; align-items:center; }
.search{ flex:1; min-width:180px; max-width:340px; }
.bulkbar{ background:var(--accent-soft); border:1px solid #bae6fd; border-radius:8px; padding:9px 14px;
          display:flex; align-items:center; gap:12px; font-size:13px; margin-bottom:14px; }
.note{ background:var(--accent-soft); border:1px solid #bae6fd; border-radius:8px; color:#075985;
       padding:9px 14px; font-size:12.5px; margin-bottom:16px; }
.empty-state{ text-align:center; padding:44px 20px; }
.empty-state h2{ font-size:17px; margin-bottom:6px; }
.inline-form{ display:inline-flex; margin-left:6px; vertical-align:middle; }
.form-panel{ max-width:860px; }
.contract-form{ max-width:1100px; }
.form-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.field{ display:flex; flex-direction:column; gap:6px; font-size:12.5px; font-weight:700; color:var(--ink); }
.field .input,.field .select{ width:100%; }
.field-wide{ grid-column:1/-1; }
.check-field{ flex-direction:row; align-items:center; color:var(--ink); padding-top:27px; }
.gps-config{ border:1px solid var(--line); border-radius:10px; padding:16px; margin:2px 0 0; min-width:0; }
.gps-config legend{ padding:0 7px; color:var(--ink); font-size:13px; font-weight:800; }
.gps-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 16px; }
.gps-help{ color:var(--muted); font-size:12px; line-height:1.5; margin:-5px 0 0; }
.gps-tools{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; }
.gps-map-link{ color:var(--accent-hover); font-size:13px; font-weight:800; }
.gps-map-link[hidden]{ display:none; }
.gps-status{ min-height:18px; margin:0; font-size:12px; font-weight:700; }
.gps-status.success{ color:#166534; }
.gps-status.error{ color:#b91c1c; }
.form-actions{ border-top:1px solid var(--line); padding:14px 18px; display:flex; gap:10px; }
.alert{ border-radius:9px; padding:10px 14px; margin-bottom:16px; font-size:13px; }
.alert.error,.alert.danger{ background:var(--red-soft); border:1px solid #fecaca; color:#991b1b; }
.alert.warn{ background:var(--amber-soft); border:1px solid #fde68a; color:#92400e; }
.help-callout{ max-width:860px; background:var(--soft); border:1px solid var(--line); border-left:4px solid var(--muted);
               border-radius:9px; color:var(--ink); padding:18px 20px; margin-bottom:20px; }
.help-callout h2{ font-size:17px; line-height:1.3; margin-bottom:12px; }
.help-callout ol{ padding-left:24px; }
.help-callout li{ padding-left:4px; }
.help-callout li + li{ margin-top:9px; }
.help-callout-note{ background:var(--card); border:1px solid var(--line); border-radius:7px; color:var(--muted);
                    font-weight:700; margin-top:16px; padding:10px 12px; }
.pill{ display:inline-flex; align-items:center; border-radius:999px; padding:3px 8px; font-size:11.5px; font-weight:700; }
.pill.ok{ background:var(--green-soft); color:#15803d; }
.pill.danger{ background:var(--red-soft); color:#b91c1c; }
.secret-box{ background:#f7fafb; border:1px solid var(--line); border-radius:8px; padding:12px; white-space:pre-wrap; word-break:break-all; }

/* calendário */
.cal{ display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:8px; }
.cal .dow{ font-size:12px; font-weight:700; color:var(--muted); text-align:center; padding-bottom:4px; }
.cal .day{ min-width:0; background:var(--card); border:1px solid var(--line); border-radius:8px; min-height:112px; padding:8px 9px;
           display:flex; flex-direction:column; gap:7px; color:inherit; text-decoration:none; position:relative; }
.cal .day.out{ background:var(--soft); color:#94a3b8; }
.cal .day .day-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:6px; min-height:18px; }
.cal .day .n{ font-size:13px; font-weight:700; color:var(--navy); }
.cal .day .tag{ flex:0 1 auto; max-width:calc(100% - 28px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
                 font-size:10px; font-weight:700; padding:2px 7px; border-radius:12px; }
.cal .day.dia .tag{ background:var(--shift-day-soft); color:var(--shift-day-text); }
.cal .day.noite .tag{ background:var(--shift-night-soft); color:var(--shift-night-text); }
.cal .day.folga .tag{ background:var(--soft); color:var(--muted); }
.cal .day.fr{ background:var(--paid-leave-soft); border-color:#c4b5fd; }
.cal .day.fr .tag{ background:#ddd6fe; color:#5b21b6; }
.cal .day.falta .tag{ background:var(--red-soft); color:#b91c1c; }
.cal .day .pt{ margin-top:4px; font-size:12px; line-height:1.45; color:var(--ink); }
.cal .day .pt b{ color:var(--navy); }
.cal .day .pt .s{ color:var(--muted); }
.cal .day.fech{ box-shadow:inset 0 3px 0 var(--accent); border-color:#bae6fd; }
.cal .day.sel{ outline:3px solid rgba(14,165,233,.28); border-color:var(--accent); }
.cal .day .flag{ font-size:11px; }
.cal .day .fechlbl{ display:block; align-self:flex-start; margin-top:auto; padding-top:6px; font-size:9.5px; font-weight:700;
                    color:var(--cyan-d); text-transform:uppercase; letter-spacing:.5px; }

/* calendário inline */
.calendar-workspace{ display:flex; gap:18px; align-items:flex-start; }
.calendar-main{ flex:1 1 auto; min-width:0; }
.calendar-edit-panel{ flex:0 0 340px; min-width:0; }
.calendar-edit-panel:empty{ display:none; }
.edit-panel-card{ margin-bottom:0; }
.edit-panel-card h2{ font-size:17px; line-height:1.2; margin-bottom:5px; }
.edit-panel-head{ display:flex; align-items:flex-start; justify-content:space-between; gap:12px; margin-bottom:16px; }
.edit-panel-head .desc{ color:var(--muted); font-size:13px; margin-top:3px; }
.edit-panel-card .form-grid{ grid-template-columns:1fr; gap:13px; }
.edit-panel-card .form-actions{ grid-column:1/-1; margin:2px -18px -18px; }
.alert.success{ background:var(--green-soft); border:1px solid #bbf7d0; color:#166534; }
.form-section-title{ grid-column:1/-1; margin:4px 0 14px; padding-bottom:8px; border-bottom:1px solid var(--line); font-size:15px; }
.form-section-title:not(:first-child){ margin-top:24px; }
.margin-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:14px; margin-bottom:16px; max-width:1100px; }
.margin-card{ display:flex; flex-direction:column; gap:5px; min-width:0; padding:17px 18px; border:1px solid #bae6fd; border-left:5px solid var(--accent); border-radius:9px; background:var(--accent-soft); color:#075985; }
.margin-card span{ font-size:12px; font-weight:850; text-transform:uppercase; letter-spacing:.5px; }
.margin-card strong{ font-size:30px; line-height:1.1; overflow-wrap:anywhere; }
.margin-card small{ font-size:12px; line-height:1.45; }
.margin-card.danger{ background:var(--red-soft); border-color:#fecaca; border-left-color:var(--red); color:#991b1b; }
.contract-period-cards{ max-width:1100px; }
.contract-period-cards .val.money{ font-size:22px; overflow-wrap:anywhere; }
.edit-panel-card .panel-hint{ background:var(--accent-soft); border:1px solid #bae6fd; color:#075985;
                              border-radius:8px; padding:9px 11px; font-size:12.5px; line-height:1.45; margin-bottom:14px; }
.edit-panel-card .panel-hint a{ font-weight:700; }

/* faturamento / invoice */
.invoice-filter{ grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); }
.invoice-overdue{ background:var(--red-soft); }
.invoice-parties,.invoice-summary,.invoice-settings{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));
  gap:16px;
  margin-bottom:16px;
}
.invoice-parties .panel-b{ display:grid; gap:8px; line-height:1.45; }
.invoice-totals{ margin-left:auto; width:min(100%,440px); padding:16px 18px; display:grid; gap:8px; }
.invoice-totals>div,.tax-row{ display:flex; justify-content:space-between; gap:20px; padding:5px 0; }
.invoice-totals .grand,.tax-row.grand{ border-top:2px solid var(--line); margin-top:4px; padding-top:12px; font-size:17px; }
.invoice-confirm{ max-width:1100px; margin-top:14px; display:flex; align-items:center; justify-content:flex-end; gap:14px; flex-wrap:wrap; }
.input-money{ min-width:120px; max-width:160px; }
.receipt-form{ display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr)); align-items:end; gap:12px; margin-top:18px; }
.invoice-settings>form{ align-self:start; }

/* escala (grade hancho) */
.escala{ overflow-x:auto; }
.escala table{ border-collapse:collapse; font-size:12.5px; min-width:760px; }
.escala th,.escala td{ border:1px solid var(--line); padding:0; text-align:center; }
.escala thead th{ background:#334155; color:#fff; padding:8px 6px; font-size:11.5px; }
.escala .name{ background:#f7fafb; text-align:left; padding:8px 12px; font-weight:600; color:var(--navy); white-space:nowrap; position:sticky; left:0; }
.escala thead th.name{ background:#334155; color:#fff; }
.escala td.cell{ width:42px; height:38px; cursor:pointer; font-weight:700; }
.escala td.D{ background:var(--shift-day-soft); color:var(--shift-day-text); }
.escala td.N{ background:var(--shift-night-soft); color:var(--shift-night-text); }
.escala td.F{ background:var(--soft-2); color:#475569; }
.escala td.yukyu{ background:var(--paid-leave-soft); color:#5b21b6; }
.escala td.X{ background:var(--red-soft); color:#b91c1c; }
.escala th.bnd, .escala td.bnd{ border-left:2px solid #7c93a0; }
.escala th.bnd{ font-size:10px; padding-left:4px; padding-right:4px; }
.escala th.fds{ background:#475569; }
.escala th .m{ display:block; font-size:9px; font-weight:700; color:#bae6fd; margin-top:1px; }
.escala .leg{ display:flex; gap:16px; margin-top:14px; font-size:12.5px; color:var(--muted); flex-wrap:wrap; }
.escala .leg b{ display:inline-block; width:18px; height:18px; border-radius:5px; vertical-align:-4px; margin-right:5px; }
.escala.leg{ display:flex; gap:16px; font-size:12.5px; color:var(--muted); flex-wrap:wrap; }
.escala.leg b{ display:inline-block; width:18px; height:18px; border-radius:5px; vertical-align:-4px; margin-right:5px; }
.legend-paid-leave{ background:var(--paid-leave-soft) !important; border:1px solid var(--paid-leave); }

/* login */
.login{ min-height:100vh; min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:16px;
        background:linear-gradient(135deg,#0f172a,#164e63); }
.login .box{ background:#fff; width:min(380px,100%); border-radius:12px; padding:34px 32px; box-shadow:0 20px 50px rgba(0,0,0,.25); }
.login img{ width:260px; max-width:100%; height:auto; display:block; margin:0 auto 22px; }
.login h2{ text-align:center; font-size:19px; margin-bottom:4px; }
.login .sub{ text-align:center; color:var(--muted); font-size:13px; margin-bottom:22px; }
.login label{ display:block; font-size:12.5px; font-weight:600; color:var(--navy); margin:14px 0 5px; }
.login .input{ width:100%; }
.login .btn-primary{ width:100%; justify-content:center; margin-top:22px; padding:11px; }
.login .foot{ text-align:center; font-size:11.5px; color:#9aa9b1; margin-top:18px; }
.login .foot a{ color:var(--accent-hover); font-weight:700; }
.language-box{ width:min(420px,100%); }
.language-list{ display:flex; flex-direction:column; gap:10px; margin-top:20px; }
.language-choice{ display:flex; align-items:center; gap:13px; border:1px solid var(--line); border-radius:8px;
                  padding:12px 14px; background:#fff; color:var(--ink); }
.language-choice:hover,.language-choice.active{ border-color:var(--accent); background:var(--accent-soft); }
.language-choice small{ display:block; color:var(--muted); font-size:11px; margin-top:2px; }
.language-flag{ width:42px; height:42px; border-radius:8px; display:flex; align-items:center; justify-content:center;
                background:var(--soft); color:var(--navy); font-weight:900; letter-spacing:.5px; }
.ponto-gps .box{ width:min(440px,100%); }
.ponto-gps-hit{ width:100%; min-height:64px; justify-content:center; font-size:18px; }
.ponto-gps .ponto-audio-controls{ margin-top:10px; }
.ponto-gps .file-picker-button{ min-height:48px; justify-content:center; }

.title-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; }
.title-row .sub{ color:var(--muted); font-size:13px; margin-top:2px; }
.report-title{ font-size:20px; font-weight:800; color:var(--ink); margin-bottom:4px; }
.report-period{ color:var(--muted); font-size:13.5px; }
.report-note{ display:block; color:var(--muted); font-size:11px; font-weight:600; margin-top:2px; text-transform:none; }
.report-alerts{ background:#fff7ed; }
.tbl th.report-alerts{ color:#9a3412; }
.tbl td.report-alerts{ border-left:3px solid var(--amber); }

/* ============================================================
   MODO ESCURO — preferência salva por login
   ============================================================ */
html[data-theme="dark"]{
  /* Cinza NEUTRO, nao azul-marinho. O fundo antigo (#0f172a) tinha +27 de azul
     sobre o vermelho e competia com os azuis da propria interface — era por isso
     que badge azul sumia no fundo. Aqui o desvio e +2.
     As cores vivas sao as MESMAS do tema claro, com uma excecao: o roxo
     #7c3aed da 2,5 de contraste contra o cinza, abaixo do minimo de 3,0, entao
     sobe para violet-400. */
  --bg:#161618; --card:#2e2e33; --ink:#f4f4f5; --muted:#a1a1aa; --line:#42424a;
  --soft:#26262a; --soft-2:#3a3a41; --sidebar:#101012; --sidebar-text:#d4d4d8;
  --accent:#0ea5e9; --accent-hover:#38bdf8; --accent-soft:#27495d;
  --green:#22c55e; --green-soft:#2c4b3b;
  --paid-leave:#a78bfa; --paid-leave-soft:#47425d;
  --amber:#f59e0b; --amber-soft:#54432b;
  --red:#ef4444; --red-soft:#6a3538;
  --shift-day:#f59e0b; --shift-day-soft:#54432b; --shift-day-text:#fde68a;
  --shift-night:#0ea5e9; --shift-night-soft:#27495d; --shift-night-text:#bae6fd;
  --navy:var(--ink); --navy-2:#d4d4d8; --navy-3:var(--sidebar);
  --cyan:var(--accent); --cyan-d:#7dd3fc;
  --shadow:0 1px 3px rgba(0,0,0,.5);
}
html[data-theme="dark"] body{ background:var(--bg); color:var(--ink); }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] .stat .val, html[data-theme="dark"] .topbar h1,
html[data-theme="dark"] .cal .day .n, html[data-theme="dark"] .escala .name,
html[data-theme="dark"] .title-row div[style]{ color:#eeeef0 !important; }
html[data-theme="dark"] .sidebar{ background:var(--sidebar); color:var(--sidebar-text); }
html[data-theme="dark"] .brand{ border-color:rgba(255,255,255,.12); }
html[data-theme="dark"] .brand img{ border-color:rgba(255,255,255,.16); }
html[data-theme="dark"] .brand small,
html[data-theme="dark"] .sidebar .foot,
html[data-theme="dark"] .nav .sep{ color:#9ea3a6; }
html[data-theme="dark"] .nav a{ color:#ced0d2; }
html[data-theme="dark"] .nav a:hover{ background:rgba(255,255,255,.08); color:#fff; }
html[data-theme="dark"] .topbar{ background:var(--card); border-color:var(--line); }
html[data-theme="dark"] .card, html[data-theme="dark"] .panel{ background:var(--card); border-color:var(--line); }
html[data-theme="dark"] .panel-h,
html[data-theme="dark"] .tbl td,
html[data-theme="dark"] .table-wrap td{ border-color:var(--line); }
html[data-theme="dark"] .tbl th,
html[data-theme="dark"] .table-wrap th,
html[data-theme="dark"] .escala thead th{ background:#414447; color:#f8fafc; }
html[data-theme="dark"] .tbl tbody tr:hover,
html[data-theme="dark"] .table-wrap tbody tr:hover{ background:#353739; }
html[data-theme="dark"] .input, html[data-theme="dark"] .select{
  background:#0f202b; color:var(--ink); border-color:#466373;
}
html[data-theme="dark"] .input::placeholder{ color:#9ea3a6; }
html[data-theme="dark"] .input:focus, html[data-theme="dark"] .select:focus{
  border-color:var(--cyan); box-shadow:0 0 0 3px rgba(56,189,240,.16);
}
html[data-theme="dark"] .btn{ background:#313335; border-color:#595e60; color:#f2f2f4; }
html[data-theme="dark"] .btn:hover{ border-color:#787e81; background:#3c4042; }
html[data-theme="dark"] .btn-ghost{ background:transparent; border-color:transparent; color:#e4e4e7; }
html[data-theme="dark"] .btn-primary{ background:var(--accent); border-color:var(--accent); color:#082f49; }
html[data-theme="dark"] .btn-primary:hover{ background:var(--accent-hover); border-color:var(--accent-hover); color:#fff; }
html[data-theme="dark"] .btn-danger{ background:var(--red); border-color:var(--red); color:#450a0a; }
html[data-theme="dark"] .btn-danger:hover{ background:#ef4444; border-color:#ef4444; color:#fff; }
html[data-theme="dark"] .cal .day{ background:var(--card); border-color:var(--line); }
html[data-theme="dark"] .cal .day.fr{ background:var(--paid-leave-soft); border-color:var(--paid-leave); }
html[data-theme="dark"] .cal .day.out{ background:#242426; color:var(--muted); }
html[data-theme="dark"] .cal .day .pt,
html[data-theme="dark"] .cal .day .pt b{ color:#f2f2f4; }
html[data-theme="dark"] .escala .name{ background:#242426; }
html[data-theme="dark"] .escala thead th.name{ background:#414447; color:#f8fafc; }
html[data-theme="dark"] .escala th,
html[data-theme="dark"] .escala td{ border-color:#4f5355; }
html[data-theme="dark"] .escala td.D{ background:var(--shift-day-soft); color:var(--shift-day-text); }
html[data-theme="dark"] .escala td.N{ background:var(--shift-night-soft); color:var(--shift-night-text); }
html[data-theme="dark"] .escala td.F{ background:#323537; color:#d7d9db; }
html[data-theme="dark"] .escala td.yukyu{ background:var(--paid-leave-soft); color:#ddd6fe; }
html[data-theme="dark"] .escala td.X{ background:var(--red-soft); color:#fecaca; }
html[data-theme="dark"] .bulkbar, html[data-theme="dark"] .note{
  background:#0c4a6e; border-color:#075985; color:#e0f2fe;
}
html[data-theme="dark"] .field{ color:#eeeef0; }
html[data-theme="dark"] .check-field{ color:var(--ink); }
html[data-theme="dark"] .alert.error,
html[data-theme="dark"] .alert.danger{ background:var(--red-soft); border-color:#7f1d1d; color:#fecaca; }
html[data-theme="dark"] .alert.warn{ background:var(--amber-soft); border-color:#92400e; color:#fde68a; }
html[data-theme="dark"] .gps-status.success{ color:#86efac; }
html[data-theme="dark"] .gps-status.error{ color:#fca5a5; }
html[data-theme="dark"] .secret-box{ background:#232327; border-color:var(--line); }
/* No escuro o preenchimento sozinho nao separa o chip do fundo: os `*-soft`
   antigos ficavam entre 1,0 e 1,6 de contraste contra o card, e o azul deles era
   quase o azul da pagina. Agora quem identifica e a BORDA na cor viva, que tem
   5,3 a 9,6 — o preenchimento fica so como tom de apoio. */
html[data-theme="dark"] .badge,
html[data-theme="dark"] .pill{ border:1px solid transparent; }
html[data-theme="dark"] .badge.ok,
html[data-theme="dark"] .pill.ok{ background:var(--green-soft); color:#bbf7d0; border-color:var(--green); }
html[data-theme="dark"] .badge.warn{ background:var(--amber-soft); color:#fde68a; border-color:var(--amber); }
html[data-theme="dark"] .badge.danger,
html[data-theme="dark"] .pill.danger{ background:var(--red-soft); color:#fecaca; border-color:var(--red); }
html[data-theme="dark"] .badge.info{ background:var(--accent-soft); color:#bae6fd; border-color:var(--accent); }
html[data-theme="dark"] .badge.neutral{ background:#414447; color:#d4d6d8; border-color:#73777c; }
html[data-theme="dark"] .report-alerts{ background:#2f2412; }
html[data-theme="dark"] .tbl th.report-alerts{ color:#fbbf24; }

/* kiosk de ponto */
.ponto-kiosk{ min-height:100vh; background:#071a24; color:#fff; }
.ponto-shell{ min-height:100vh; display:grid; grid-template-rows:auto 1fr; gap:18px;
              padding:26px; background:radial-gradient(circle at top,#17455d,#071a24 62%); }
.ponto-ready .ponto-shell{ grid-template-rows:auto 1fr; }
.ponto-header{ display:flex; align-items:center; justify-content:space-between; gap:16px; }
.ponto-brand{ color:var(--cyan); font-size:19px; font-weight:900; letter-spacing:2px; }
.ponto-header h1{ color:#fff; font-size:34px; line-height:1.1; margin-top:2px; }
.ponto-device{ color:#b8c8d3; font-size:13px; }
.ponto-setup{ display:flex; align-items:center; justify-content:center; }
.ponto-setup[hidden], .ponto-camera[hidden]{ display:none; }
.ponto-card{ width:min(520px,100%); background:#fff; color:var(--ink); border-radius:12px;
             padding:26px; box-shadow:0 24px 70px rgba(0,0,0,.35); }
.ponto-card h2{ font-size:24px; margin-bottom:6px; }
.ponto-card .field{ margin:20px 0 16px; }
.ponto-camera{ display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:24px; align-items:stretch; min-height:0; }
.ponto-video-wrap{ position:relative; overflow:hidden; border-radius:12px; background:#000;
                   border:1px solid rgba(255,255,255,.14); box-shadow:0 24px 70px rgba(0,0,0,.35); }
.ponto-video-wrap video{ width:100%; height:100%; min-height:420px; object-fit:cover; display:block; }
.ponto-video-state{ position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
                    color:#dfeaf1; background:rgba(0,0,0,.45); font-size:18px; }
.ponto-video-state[hidden]{ display:none; }
.ponto-actions{ display:flex; flex-direction:column; justify-content:center; gap:18px; }
.ponto-audio-controls{ display:flex; align-items:stretch; gap:8px; width:100%; }
.ponto-audio-toggle{ border:1px solid rgba(255,255,255,.2); border-radius:10px; padding:11px 14px;
                     background:rgba(255,255,255,.08); color:inherit; cursor:pointer; font-weight:700;
                     flex:1 1 auto; justify-content:center; }
.ponto-audio-toggle:hover{ background:rgba(255,255,255,.14); }
.ponto-voice-field{ display:flex; align-items:center; gap:6px; border:1px solid rgba(255,255,255,.2);
                    border-radius:10px; padding:5px 7px 5px 10px; font-size:12px; font-weight:700; }
.ponto-voice-select{ min-width:94px; border:1px solid rgba(255,255,255,.24); border-radius:7px;
                     padding:6px 24px 6px 7px; background:#123448; color:#fff; font:inherit; }
.ponto-gps .ponto-audio-toggle{ border-color:var(--line); background:var(--soft); color:var(--ink); }
.ponto-gps .ponto-audio-toggle:hover{ border-color:var(--accent); background:var(--accent-soft); }
.ponto-gps .ponto-voice-field{ border-color:var(--line); color:var(--ink); }
.ponto-gps .ponto-voice-select{ border-color:var(--line); background:#fff; color:var(--ink); }
.ponto-hit{ border:0; border-radius:16px; min-height:190px; padding:26px; cursor:pointer;
            background:var(--cyan); color:#fff; font-size:38px; font-weight:900;
            box-shadow:0 18px 0 var(--cyan-d), 0 28px 60px rgba(0,0,0,.32); }
.ponto-hit:active{ transform:translateY(8px); box-shadow:0 10px 0 var(--cyan-d), 0 18px 42px rgba(0,0,0,.32); }
.ponto-hit:disabled{ opacity:.58; cursor:not-allowed; transform:none; box-shadow:none; }
.ponto-status,.ponto-pending{ background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.12);
                              border-radius:10px; padding:14px 16px; color:#dfeaf1; font-size:18px; }
.ponto-pending{ font-size:15px; color:#b8c8d3; }
.ponto-token-switch{
  position:fixed; right:22px; top:20px; z-index:10; width:38px; height:38px; display:flex;
  align-items:center; justify-content:center; border:1px solid rgba(255,255,255,.14);
  background:rgba(7,26,36,.38); color:#b8c8d3; border-radius:999px; padding:0; cursor:pointer;
}
.ponto-token-switch:hover{ color:#fff; border-color:rgba(255,255,255,.32); background:rgba(7,26,36,.78); }
.ponto-token-switch[hidden]{ display:none; }
.ponto-token-switch svg{ width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.ponto-language-link{ position:fixed; right:70px; top:26px; z-index:10; color:#b8c8d3; font-size:12px; font-weight:700; }
.ponto-language-link:hover{ color:#fff; }
.ponto-result{ position:fixed; inset:0; z-index:20; display:flex; flex-direction:column; align-items:center;
               justify-content:center; text-align:center; padding:28px; background:rgba(7,26,36,.94); }
.ponto-result[hidden]{ display:none; }
.ponto-result-main{ font-size:clamp(42px,8vw,94px); font-weight:900; line-height:1.05; }
.ponto-result-sub{ margin-top:18px; font-size:clamp(28px,5vw,58px); font-weight:800; }
.ponto-result.ok .ponto-result-sub{ color:#78e6a2; }
.ponto-result.warn .ponto-result-sub{ color:#ffd18c; }

@media (max-width:1200px){
  .app{ grid-template-columns:232px minmax(0,1fr); }
  .brand{ padding-inline:14px; }
  .nav{ padding-inline:9px; }
  .topbar{ padding-inline:24px; }
  .content{ padding:24px; }
  .dashboard-grid{ grid-template-columns:1fr; }
  .calendar-workspace{ flex-direction:column; }
  .calendar-edit-panel{ flex-basis:auto; width:100%; }
}

@media (max-width:900px){
  .app{ grid-template-columns:1fr; }
  .sidebar{ position:static; }
  .nav{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
  /* O cabecalho de grupo NAO some no celular. Escondia-lo transformava o menu
     numa grade plana de 23 itens — justamente o problema que os cinco grupos
     resolveram no desktop. Ele passa a ocupar a linha inteira da grade. */
  .nav .sep{ grid-column:1 / -1; margin:10px 2px 2px; padding-top:8px;
             border-top:1px solid rgba(255,255,255,.08); }
  .nav .sep.first{ margin-top:2px; border-top:0; padding-top:0; }
  .sidebar .foot{ display:none; }
  .topbar{ padding-block:14px; }
  .ponto-shell{ padding:18px; }
  .ponto-header{ align-items:flex-start; flex-direction:column; }
  .ponto-camera{ grid-template-columns:1fr; }
  .ponto-video-wrap video{ min-height:330px; }
  .ponto-hit{ min-height:132px; font-size:30px; }
}

@media (max-width:600px){
  .nav{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  /* "Revisar fotos faciais" tem 21 caracteres numa celula de ~160px a 360px.
     `hyphens:auto` quebra na silaba em vez de estourar a caixa, e o `lang` do
     <html> ja diz ao navegador qual dicionario usar. */
  .nav a{ hyphens:auto; line-height:1.25; }
  .topbar{ padding:14px 16px; align-items:flex-start; flex-direction:column; }
  .usermenu{ width:100%; gap:8px; }
  .content{ padding:16px; }
  .page-intro,.title-row{ align-items:flex-start; flex-direction:column; }
  .form-grid,.gps-grid{ grid-template-columns:1fr; }
  .form-actions{ flex-wrap:wrap; }
  .login .box{ padding:26px 20px; }
  .ponto-gps{ align-items:flex-start; }
  .ponto-gps .file-picker{ align-items:stretch; flex-direction:column; }
  .ponto-gps .file-picker-button{ width:100%; }
  .ponto-shell{ padding:14px; gap:14px; }
  .ponto-header{ padding-right:104px; }
  .ponto-header h1{ font-size:clamp(26px,9vw,34px); }
  .ponto-camera{ gap:14px; }
  .ponto-video-wrap video{ min-height:clamp(220px,42vh,330px); }
  .ponto-actions{ gap:12px; }
  .ponto-audio-controls{ flex-wrap:wrap; }
  .ponto-voice-field{ flex:1 1 auto; justify-content:space-between; }
  .ponto-hit{ min-height:112px; padding:20px; font-size:26px; }
  .ponto-status,.ponto-pending{ padding:10px 12px; font-size:15px; }
  .cal{ gap:4px; }
  .cal .day{ min-height:92px; padding:6px 4px; }
}

/* furigana (ruby): leitura em katakana por cima do nome; toggle no topo */
ruby rt{ font-size:.58em; color:var(--muted); font-weight:600; user-select:none; line-height:1.1; }
html[data-furigana="off"] rt{ display:none; }

/* --- Abas (UX-4) -----------------------------------------------------------
   Ja existia `class="tabs"` em comunicacoes.html SEM estilo nenhum — as abas
   apareciam como tres links soltos. A guarda de classe sem CSS acusou junto com
   as abas de Jornada.

   Sublinhado embaixo em vez de caixa: pesa menos numa tela que ja tem painel,
   tabela e filtro. `aria-current` cuida do leitor de tela; a cor cuida do resto.

   `overflow-x:auto` porque a 360px tres abas com rotulo em japones nao cabem, e
   a alternativa (quebrar linha) empurra o conteudo da tela para baixo. */
.tabs{
  display:flex; gap:4px; margin-bottom:16px; overflow-x:auto;
  border-bottom:1px solid var(--line);
}
.tabs a{
  padding:10px 16px; color:var(--muted); text-decoration:none; white-space:nowrap;
  border-bottom:2px solid transparent; margin-bottom:-1px; font-size:14px;
}
.tabs a:hover{ color:var(--ink); }
.tabs a.ativa{ color:var(--accent); border-bottom-color:var(--accent); font-weight:650; }
.tabs a:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }

/* --- Card clicavel (UX-3) --------------------------------------------------
   O card INTEIRO e o link, e nao um botao "Ver" dentro dele: alvo grande, um
   destino so, e nada competindo pelo clique.

   `color:inherit` e `text-decoration:none` porque o card ja parece clicavel
   pelo relevo — sublinhar o numero o faria parecer um link de texto solto
   dentro de um cartao. O que sinaliza a interacao e o hover e o foco.

   `:focus-visible` com contorno proprio: sem ele quem navega por teclado
   atravessa seis cards sem saber em qual esta. */
a.card{ color:inherit; text-decoration:none; display:block; }
a.card:hover{ border-color:var(--accent); transform:translateY(-1px); }
a.card:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
a.card .val{ text-decoration:none; }

/* --- Paginacao das listagens (#17) -----------------------------------------
   Anterior/Proxima nas pontas e a faixa no meio. `flex-wrap` porque a 360px os
   tres nao cabem lado a lado, e ai a faixa desce sozinha em vez de espremer os
   botoes abaixo do alvo de toque.

   O botao inativo continua ocupando o mesmo espaco (span, nao ausencia): sem
   isso "Proxima" pula para a esquerda ao chegar na ultima pagina, e o dedo
   acerta o botao errado por memoria muscular. */
.paginacao{
  display:flex; align-items:center; justify-content:space-between;
  flex-wrap:wrap; gap:10px; margin-top:14px;
}
.paginacao [aria-disabled="true"]{ opacity:.4; cursor:default; }
.paginacao .muted{ font-size:13px; }

/* Busca dentro do cabecalho de um painel. Encolhe antes de quebrar a linha. */
.filtro-inline{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.filtro-inline .input{ min-width:0; width:clamp(140px, 30vw, 240px); }

/* --- Toque -----------------------------------------------------------------
   O criterio aqui e o DEDO, nao a largura da tela: tablet de 1024px deitado
   precisa de alvo grande igual, e monitor de 1024px nao precisa. Por isso
   `pointer:coarse` em vez de mais um breakpoint de largura.

   Medido a 360px antes desta regra: item de menu 39px, botao 37px, campo 33px —
   todos abaixo dos 44px de alvo minimo. Na fabrica o telefone e usado as vezes
   de luva. A densidade do desktop fica intacta, o bloco so vale no toque. */
@media (pointer:coarse){
  .nav a, .btn, button.btn, a.btn{ min-height:44px; display:flex; align-items:center; }
  .btn, button.btn, a.btn{ justify-content:center; padding:10px 14px; }

  /* 16px NAO e escolha estetica: abaixo disso o Safari do iOS AMPLIA a pagina
     ao focar o campo, e o usuario perde o formulario de vista no meio do
     preenchimento. Nao existe como desligar isso a nao ser com a fonte. */
  .input, input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
  select, textarea{ font-size:16px; min-height:44px; }

  /* Nome clicavel dentro da celula: 18px de altura numa linha so. Nao da para
     usar `min-height` aqui — a tabela ja tem 182px por linha e esticar a celula
     empurra a largura, que no celular e o recurso escasso. O par
     `padding-block` + `margin-block` negativo cresce a AREA DE TOQUE sem mexer
     no layout: 18 + 13 + 13 = 44px de alvo, linha do mesmo tamanho.
     Medido antes de aplicar: a folga vertical entre dois links empilhados na
     mesma coluna e de 94px, entao as areas ampliadas nao se sobrepoem. */
  .link-entidade{ padding-block:13px; margin-block:-13px; }

  /* Troca de idioma: 15px de alvo na tela de login, e e o controle que o
     trabalhador japones ou brasileiro precisa achar ANTES de conseguir entrar.
     A regra mira o destino (`href^="/idioma"`) em vez da classe porque o link
     aparece em cinco templates e so um tem classe propria — mirando a classe,
     o proximo template nasce sem o alvo grande e ninguem percebe.
     Mesma tecnica do link de entidade: area cresce, layout nao mexe. */
  a[href^="/idioma"]{ padding-block:15px; margin-block:-15px; }

  /* Caixa de marcar e o alvo mais dificil de acertar de todos. */
  input[type=checkbox], input[type=radio]{ width:20px; height:20px; }
}
