/* =========================================================
   Gestor de Escalas Team — identidade visual da Team Contabilidade
   Base branca e cinza-clara, estrutura em grafite, vermelho Team como acento.
   Tokens da marca (--team-*) e tokens de uso (--accent, --ink…) no :root;
   tema escuro em [data-theme="dark"] e, no modo "Sistema", via prefers-color-scheme.
   ========================================================= */

:root {
  color-scheme: light;

  /* Marca */
  --team-red: #ea2016;
  --team-red-600: #d41b12;
  --team-red-700: #c8170f;
  --team-red-800: #b5140d;
  --team-red-100: #fdeceb;
  --team-red-50: #fff6f5;

  /* Neutros */
  --team-graphite: #15181d;
  --team-ink: #14171c;
  --team-muted: #5b6472;
  --team-subtle: #6b7380;
  --team-line: #e3e6ea;
  --team-bg: #f5f6f8;
  --team-bg-2: #f1f2f4;
  --team-surface: #ffffff;

  /* Sobre grafite */
  --team-on-dark: #ffffff;
  --team-on-dark-muted: #c9ced6;
  --team-red-on-dark: #ff4a42;

  /* Estados */
  --team-green-700: #0f6e48;
  --team-green: #178a5b;
  --team-green-100: #e5f4ec;
  --team-amber-800: #92400e;
  --team-amber-500: #f59e0b;
  --team-amber-100: #fef3c7;

  /* Tipografia */
  --font-display: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Forma */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(20, 23, 28, .06);
  --shadow-pop: 0 8px 24px rgba(20, 23, 28, .12);
  --shadow-modal: 0 24px 60px rgba(20, 23, 28, .18);
  --ease: cubic-bezier(.2, .7, .3, 1);

  /* ----- Tokens de uso (mudam no tema escuro) ----- */
  --accent: var(--team-red-600);          /* fundo do botão principal */
  --accent-hover: var(--team-red-700);
  --accent-press: var(--team-red-800);
  --accent-mark: var(--team-red);         /* faixas, quadrados de ícone, bordas de destaque */
  --accent-text: var(--team-red-700);     /* texto e links vermelhos */
  --accent-soft: var(--team-red-50);      /* fundo muito suave, item ativo */
  --accent-tint: var(--team-red-100);     /* fundo suave de destaque */
  --danger: var(--team-red-700);

  --bg: var(--team-bg);
  --surface: var(--team-surface);
  --surface-2: var(--team-bg-2);
  --line: var(--team-line);
  --line-strong: #cdd2d9;
  --ink: var(--team-ink);
  --ink-2: var(--team-muted);
  --ink-3: var(--team-subtle);

  --head-bg: var(--team-graphite);
  --head-fg: var(--team-on-dark);
  --head-muted: var(--team-on-dark-muted);
  --head-red: var(--team-red-on-dark);
  --head-line: rgba(255, 255, 255, .14);

  --avatar-bg: var(--team-graphite);
  --avatar-fg: #ffffff;

  /* Escala */
  --folga-bg: var(--team-green-100);
  --folga-fg: var(--team-green-700);
  --ferias-bg: var(--team-bg-2);
  --ferias-fg: var(--team-muted);
  --afast-bg: #e9ebee;
  --afast-fg: #3f4652;
  --sun-bg: var(--team-red-50);
  --today-bg: #fbfbfc;
  --tag-ab-bg: var(--team-red-100);
  --tag-ab-fg: var(--team-red-700);
  --tag-fe-bg: var(--team-graphite);
  --tag-fe-fg: #ffffff;
  --tag-bg: var(--team-bg-2);
  --tag-fg: var(--team-muted);

  /* Atenção, sucesso */
  --warn-bg: var(--team-amber-100);
  --warn-line: var(--team-amber-500);
  --warn-fg: var(--team-amber-800);
  --ok-bg: var(--team-green-100);
  --ok-line: var(--team-green);
  --ok-fg: var(--team-green-700);

  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--team-red-600);
  --sidebar-w: 248px;
  --topbar-h: 68px; /* 64 px + faixa vermelha de 4 px */

  /* Ícones brancos dos quadrados vermelhos de seção */
  --ico-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --ico-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20c.6-3.6 3.2-5.5 6.5-5.5s5.9 1.9 6.5 5.5M16 4.8a3.5 3.5 0 0 1 0 6.4M18 14.8c1.9.7 3.1 2.4 3.5 5.2'/%3E%3C/svg%3E");
  --ico-user-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='10' cy='8' r='3.5'/%3E%3Cpath d='M3 20c.7-3.7 3.4-5.6 7-5.6 1.5 0 2.8.3 3.9 1M19 14v6M16 17h6'/%3E%3C/svg%3E");
  --ico-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
  --ico-sliders: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12'/%3E%3Ccircle cx='16' cy='6' r='2'/%3E%3Ccircle cx='10' cy='12' r='2'/%3E%3Ccircle cx='18' cy='18' r='2'/%3E%3C/svg%3E");
  --ico-building: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21h18M5 21V8l7-4 7 4v13M9 21v-5h6v5'/%3E%3C/svg%3E");
  --ico-key: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='3.5'/%3E%3Cpath d='M5 20c.7-3.7 3.4-5.6 7-5.6s6.3 1.9 7 5.6'/%3E%3C/svg%3E");
  --ico-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 20h20L12 3z'/%3E%3Cpath d='M12 10v4M12 17h0'/%3E%3C/svg%3E");
  --ico-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6h11M9 12h11M9 18h11M4 6h0M4 12h0M4 18h0'/%3E%3C/svg%3E");
}

/* Tema escuro: grafite como base, o vermelho continua como acento */
:root[data-theme="dark"] {
  color-scheme: dark;
  --accent-text: #ff6b63;
  --accent-soft: #2a1715;
  --accent-tint: #3a1a17;
  --danger: #ff6b63;
  --bg: #0e1013;
  --surface: #171a1f;
  --surface-2: #1e2229;
  --line: #2a2f37;
  --line-strong: #3a404a;
  --ink: #eceef1;
  --ink-2: #b4bbc6;
  --ink-3: #959eab;
  --head-bg: #0a0b0d;
  --avatar-bg: #2a2f37;
  --avatar-fg: #eceef1;
  --folga-bg: #12301f;
  --folga-fg: #6fd3a0;
  --ferias-bg: #23272e;
  --ferias-fg: #b4bbc6;
  --afast-bg: #2a2f37;
  --afast-fg: #d2d7de;
  --sun-bg: #1f1513;
  --today-bg: #1b1f25;
  --tag-ab-bg: #3a1a17;
  --tag-ab-fg: #ff8a83;
  --tag-fe-bg: #eceef1;
  --tag-fe-fg: #15181d;
  --tag-bg: #262a31;
  --tag-fg: #c3c9d2;
  --warn-bg: #3a2a0a;
  --warn-line: #f59e0b;
  --warn-fg: #fcd34d;
  --ok-bg: #12301f;
  --ok-line: #3fbf86;
  --ok-fg: #6fd3a0;
  --shadow-card: none;
  --shadow-pop: 0 8px 24px rgba(0, 0, 0, .5);
  --shadow-modal: 0 24px 60px rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --accent-text: #ff6b63;
    --accent-soft: #2a1715;
    --accent-tint: #3a1a17;
    --danger: #ff6b63;
    --bg: #0e1013;
    --surface: #171a1f;
    --surface-2: #1e2229;
    --line: #2a2f37;
    --line-strong: #3a404a;
    --ink: #eceef1;
    --ink-2: #b4bbc6;
    --ink-3: #959eab;
    --head-bg: #0a0b0d;
    --avatar-bg: #2a2f37;
    --avatar-fg: #eceef1;
    --folga-bg: #12301f;
    --folga-fg: #6fd3a0;
    --ferias-bg: #23272e;
    --ferias-fg: #b4bbc6;
    --afast-bg: #2a2f37;
    --afast-fg: #d2d7de;
    --sun-bg: #1f1513;
    --today-bg: #1b1f25;
    --tag-ab-bg: #3a1a17;
    --tag-ab-fg: #ff8a83;
    --tag-fe-bg: #eceef1;
    --tag-fe-fg: #15181d;
    --tag-bg: #262a31;
    --tag-fg: #c3c9d2;
    --warn-bg: #3a2a0a;
    --warn-line: #f59e0b;
    --warn-fg: #fcd34d;
    --ok-bg: #12301f;
    --ok-line: #3fbf86;
    --ok-fg: #6fd3a0;
    --shadow-card: none;
    --shadow-pop: 0 8px 24px rgba(0, 0, 0, .5);
    --shadow-modal: 0 24px 60px rgba(0, 0, 0, .6);
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); margin: 0; }
h1 { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 800; line-height: 1.2; letter-spacing: -.01em; margin-bottom: 14px; }
h3 { font-size: 17px; font-weight: 700; line-height: 1.3; }
h4 { font-size: 16px; font-weight: 700; margin: 18px 0 6px; }
p { margin: 0 0 8px; }
a { color: var(--accent-text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.mono { font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; }
.text-danger { color: var(--danger); }

:focus-visible { outline: none; box-shadow: var(--focus-ring); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Sobretítulo vermelho acima do título da página (assinatura Team) */
.eyebrow {
  margin: 0 0 6px; font-family: var(--font-display); font-size: 12px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text);
}

/* Título de seção com o quadrado vermelho de ícone */
.sec-title { display: flex; align-items: center; gap: 10px; }
.sec-title::before {
  content: ""; flex: none; width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent-mark) var(--ico, var(--ico-list)) center / 16px 16px no-repeat;
}
[data-ico="calendar"] { --ico: var(--ico-calendar); }
[data-ico="users"] { --ico: var(--ico-users); }
[data-ico="user-plus"] { --ico: var(--ico-user-plus); }
[data-ico="clock"] { --ico: var(--ico-clock); }
[data-ico="sliders"] { --ico: var(--ico-sliders); }
[data-ico="building"] { --ico: var(--ico-building); }
[data-ico="key"] { --ico: var(--ico-key); }
[data-ico="alert"] { --ico: var(--ico-alert); }
[data-ico="list"] { --ico: var(--ico-list); }

/* ---------- Cabeçalho grafite com faixa vermelha ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  background: var(--head-bg); color: var(--head-fg);
  border-bottom: 4px solid var(--accent-mark);
}
.brand { display: flex; align-items: center; gap: 16px; min-width: 0; color: inherit; text-decoration: none; border-radius: var(--radius); }
.brand-logo { height: 28px; width: auto; display: block; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; padding-left: 16px; border-left: 1px solid var(--head-line); }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 16px; line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; }
.brand-sub { font-size: 13px; color: var(--head-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42ch; }
.mobile-title { display: none; }
.topbar :focus-visible { box-shadow: 0 0 0 2px var(--head-bg), 0 0 0 4px var(--head-red); }

/* Lado direito do cabeçalho: botão de tema e menu do usuário */
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.theme-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--head-line); border-radius: var(--radius); background: transparent; color: var(--head-fg); cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.theme-btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .3); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .ti { display: none; }
.theme-btn[data-mode="light"] .ti-light, .theme-btn[data-mode="dark"] .ti-dark, .theme-btn[data-mode="auto"] .ti-auto { display: block; }

.user-box { position: relative; min-width: 0; }
.user-trigger {
  display: flex; align-items: center; gap: 10px; min-width: 0; height: 48px; padding: 0 10px 0 6px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--head-fg);
  font: inherit; text-align: left; cursor: pointer; transition: background .15s var(--ease);
}
.user-trigger:hover, .user-trigger[aria-expanded="true"] { background: rgba(255, 255, 255, .08); }
.user-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--team-red-600); color: #fff; font-family: var(--font-display); font-size: 12px; font-weight: 800;
}
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name { font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--head-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.user-role { font-size: 12px; line-height: 1.3; color: var(--head-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40ch; }
.user-chevron { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--head-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s var(--ease); }
.user-trigger[aria-expanded="true"] .user-chevron { transform: rotate(180deg); }
.user-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; min-width: 220px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop);
}
.user-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 500; text-align: left; cursor: pointer;
}
.user-menu button:hover, .user-menu button:focus-visible { background: var(--surface-2); box-shadow: none; }
.user-menu button:focus-visible { outline: 2px solid var(--team-red-600); outline-offset: -2px; }
.user-menu svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ink-2); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.user-menu #btn-logout { color: var(--accent-text); }
.user-menu #btn-logout svg { stroke: currentColor; }

.menu-toggle {
  display: none; place-items: center; width: 40px; height: 40px; flex: none;
  border: 0; border-radius: var(--radius); background: transparent; color: inherit; cursor: pointer;
}

/* ---------- Menu lateral (branco) ---------- */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; z-index: 30; width: var(--sidebar-w);
  display: flex; flex-direction: column; overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line); padding: 20px 12px 16px;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px;
  padding: 8px 12px; border: 0; border-radius: var(--radius); background: transparent;
  color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; text-align: left;
  text-decoration: none; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease);
}
.nav svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-3); }
.nav-text { flex: 1; }
.nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.nav a.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent-mark);
}
.nav a.active svg { color: var(--accent-text); }
.nav-group {
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3); padding: 20px 12px 6px;
}
.nav-badge {
  min-width: 24px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill);
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--ink-2);
}
.nav a.active .nav-badge { background: var(--surface); color: var(--ink); }
.nav-badge.alert, .nav a.active .nav-badge.alert { background: var(--warn-bg); color: var(--warn-fg); box-shadow: inset 0 0 0 1px var(--warn-line); }

.side-foot { margin-top: auto; padding-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.side-summary { border-top: 1px solid var(--line); padding: 16px 8px 0; }
.sum-title { font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px; }
.sum-total { display: flex; align-items: baseline; gap: 8px; }
.sum-total strong { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.sum-total span { color: var(--ink-2); font-size: 13px; }
.sum-split { font-size: 13px; color: var(--ink-2); margin: 6px 0 10px; }
.sum-split strong { color: var(--ink); font-weight: 600; }
.sum-cargos { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 168px; overflow-y: auto; }
.sum-cargos li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.sum-cargos li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sum-cargos li span:last-child { font-weight: 600; font-variant-numeric: tabular-nums; }


/* Marca d'água de desenvolvimento (FourTech), discreta */
.dev-mark { margin: 0; padding: 0 8px; font-size: 12px; color: var(--ink-3); }
.dev-mark img { height: 16px; width: auto; display: block; }

/* Empresa em ajuste (master) */
.company-picker { margin: 0 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); }
.company-picker label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.company-picker select { width: 100%; height: 38px; font-weight: 600; }
.company-empty { margin: 0; font-size: 13px; color: var(--ink-2); }
.company-empty a { font-weight: 600; }

.sidebar-backdrop { display: none; }

/* ---------- Área principal ---------- */
.container { max-width: calc(1440px + var(--sidebar-w)); margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 28px) 32px 48px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.page-head h1 .year { font-weight: 700; color: var(--ink-3); }
.page-head p { margin: 8px 0 0; max-width: 72ch; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Componentes ---------- */
.panel, .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { background: var(--bg); border-color: var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.primary:active { background: var(--accent-press); border-color: var(--accent-press); }
.btn.dark { background: var(--team-graphite); border-color: var(--team-graphite); color: #fff; }
.btn.dark:hover { background: #2a2f37; border-color: #2a2f37; }
:root[data-theme="dark"] .btn.dark { background: #eceef1; border-color: #eceef1; color: #15181d; }
:root[data-theme="dark"] .btn.dark:hover { background: #ffffff; border-color: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn.dark { background: #eceef1; border-color: #eceef1; color: #15181d; }
  :root:not([data-theme="light"]) .btn.dark:hover { background: #ffffff; border-color: #ffffff; }
}
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent-text); }
.btn.ghost:hover { background: var(--accent-soft); }
.btn.danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--accent-soft); }
.modal-foot .btn.danger { background: var(--accent); border-color: var(--accent); color: #fff; }
.modal-foot .btn.danger:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.square { width: 40px; padding: 0; }
.btn svg { flex: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface); border-color: var(--line); }
.btn.primary:disabled:hover { background: var(--accent); border-color: var(--accent); }
.btn.small-btn { height: 32px; padding: 0 12px; font-size: 13px; }
.file-btn { position: relative; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; font-size: 20px; line-height: 1; transition: background .15s var(--ease);
}
.icon-btn:hover { background: var(--bg); border-color: var(--line-strong); }
.icon-btn svg { flex: none; }
.link { background: none; border: 0; color: var(--ink); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; padding: 4px 8px; border-radius: var(--radius-sm); }
.link:hover { color: var(--accent-text); background: var(--accent-soft); }
.link.danger { color: var(--danger); }

input, select, textarea {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface); min-width: 0;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder { color: var(--ink-3); }
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--team-red-600); box-shadow: var(--focus-ring); }
input[aria-invalid="true"] { border-color: var(--team-red-700); background: var(--accent-soft); }
input[type="search"] {
  padding-left: 36px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7380' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") 12px center / 16px no-repeat;
}

.empty { padding: 48px 24px; text-align: center; color: var(--ink-2); }
.empty.big { padding: 64px 24px; }
.empty.big::before {
  content: ""; display: block; width: 40px; height: 40px; margin: 0 auto 16px;
  background: var(--ink-3);
  -webkit-mask: var(--ico-users) center / contain no-repeat; mask: var(--ico-users) center / contain no-repeat;
}
.empty.big p:first-child { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--ink); }
.empty .btn { margin-top: 12px; }

.form-error {
  display: flex; gap: 8px; color: var(--team-red-700); background: var(--team-red-50);
  border: 1px solid #f6c9c6; border-left: 4px solid var(--team-red-700); padding: 10px 12px; border-radius: var(--radius); margin: 0; font-size: 14px;
}
.form-error::before { content: "!"; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--team-red-700); color: #fff; font-size: 12px; font-weight: 700; }
:root[data-theme="dark"] .form-error { background: var(--accent-soft); border-color: #5a2522; color: #ff8a83; }
.field-hint { font-size: 12px; font-weight: 400; color: var(--ink-2); margin: 0; }
.hint { font-size: 13px; color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 14px; margin: 2px 0 0; }

/* Chips e etiquetas (pílula, com ícone ou texto além da cor) */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: var(--radius-pill);
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; text-decoration: none; color: var(--ink);
}
.chip.ok { background: var(--ok-bg); border-color: transparent; color: var(--ok-fg); }
.chip.ok::before { content: "✓"; }
.chip.danger { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-fg); }
.chip.warn { background: var(--team-amber-100); border-color: var(--team-amber-500); color: var(--team-amber-800); }
.chip.danger::before { content: "!"; font-weight: 800; }
.chip.off { background: var(--surface-2); color: var(--ink-2); }
.role-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.role-badge.r-master { background: var(--team-graphite); color: #fff; }
.role-badge.r-gerente { background: var(--accent-tint); color: var(--accent-text); }
:root[data-theme="dark"] .role-badge.r-master { background: #eceef1; color: #15181d; }

/* Tabelas: contêiner branco, cabeçalho grafite */
.list-card { overflow: hidden; }
.list-tools { padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list-tools input { width: min(380px, 100%); }
.table-wrap { overflow-x: auto; }
.table-wrap.small { max-height: 270px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); margin: 12px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; position: sticky; top: 0; z-index: 1;
  background: var(--head-bg); color: var(--head-fg);
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.table th, .table td { padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table.compact th, .table.compact td { padding: 8px 12px; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--bg); }
.table tr.selected td { background: var(--accent-soft); }
.row-actions { text-align: right; }
.sex-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-2); }
.sex-badge::before { font-size: 15px; color: var(--ink); }
.sex-badge.M::before { content: "♂"; }
.sex-badge.F::before { content: "♀"; }
.error-list { margin: 0; padding-left: 18px; max-height: 190px; overflow: auto; color: var(--warn-fg); }

/* ---------- Funcionários ---------- */
.layout-2 { display: grid; grid-template-columns: 360px 1fr; gap: 24px; align-items: start; }
.form { padding: 24px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--topbar-h) + 24px); }
.form h2 { margin: 0; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form input, .form select, .form-grid input, .form-grid select { width: 100%; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; }
.inline-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.inline-filter select { max-width: 260px; }
.role-desc { margin: -4px 0 0; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); font-size: 13px; color: var(--ink-2); }
.form-grid select { width: 100%; }

/* ---------- Escala: cabeçalho da semana ---------- */
.week-head { margin-bottom: 20px; }
.week-head .page-head { margin-bottom: 20px; }
/* Selo de data (assinatura Team): período da escala */
.date-seal {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; margin: 12px 0 0 !important;
  border-radius: var(--radius-sm); background: var(--team-red-600); color: #fff;
  font-family: var(--font-display); font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.date-seal svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.week-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.week-nav input[type="date"] { width: 160px; }

/* Indicadores do dia */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi { padding: 16px 20px; }
.kpi-label { font-size: 13px; color: var(--ink-2); }
.kpi-label span { color: var(--ink-3); }
.kpi-num { margin-top: 6px; font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi.k-folga .kpi-num { color: var(--folga-fg); }

/* ---------- Escala: ferramentas ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 16px; justify-content: space-between; align-items: center; padding: 12px 16px; margin-bottom: 12px; }
.tool-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar input[type="search"] { width: 200px; }
.brushes { padding: 3px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.brush {
  display: inline-flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.brush::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-strong); }
.brush.b-toggle::before { background: linear-gradient(135deg, var(--surface) 50%, var(--folga-fg) 50%); }
.brush.b-BH::before { background: var(--surface); border: 1px dashed var(--folga-fg); }
.brush.b-FE::before { background: var(--ferias-bg); }
.brush.b-AT::before { background: var(--afast-bg); border-color: var(--afast-fg); }
.brush.b-T::before { background: var(--surface); }
.brush:hover { color: var(--ink); background: var(--surface); }
.brush.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 23, 28, .14), inset 0 -2px 0 var(--accent-mark); }

.status-line { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; }
.legend { margin-left: auto; display: flex; align-items: center; gap: 6px 16px; color: var(--ink-2); flex-wrap: wrap; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.lg {
  display: inline-grid; place-items: center; width: 26px; height: 22px; border-radius: var(--radius-sm);
  font-size: 11px; font-weight: 600; border: 1px solid var(--line); background: var(--surface);
}
.lg.sun { background: var(--sun-bg); color: var(--accent-text); }

/* ---------- Escala: opções de horário e limite de folgas ---------- */
.options-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; padding: 12px 16px; margin-bottom: 12px; }
.opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 14px; }
.opt-label { font-weight: 600; color: var(--ink); font-size: 13px; }
.opt-end { margin-left: auto; }
.opt-link { font-weight: 600; text-decoration: none; }
.opt-link:hover { text-decoration: underline; }
/* Amostras da legenda: mesma cor e um código, nunca só a cor */
.sw {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 4px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); font-size: 11px; font-weight: 700; line-height: 1;
}
.sw-ab { background: var(--tag-ab-bg); color: var(--tag-ab-fg); border-color: transparent; }
.sw-ab::before { content: "A"; }
.sw-fe { background: var(--tag-fe-bg); color: var(--tag-fe-fg); border-color: transparent; }
.sw-fe::before { content: "FC"; }
.sw-F { background: var(--folga-bg); color: var(--folga-fg); border-color: transparent; }
.sw-F::before { content: "DSR"; }
.sw-BH { background: var(--surface); color: var(--folga-fg); border: 1px dashed var(--folga-fg); }
.sw-BH::before { content: "BH"; }
.sw-FE { background: var(--ferias-bg); color: var(--ferias-fg); }
.sw-FE::before { content: "FÉR"; }
.sw-AT { background: var(--afast-bg); color: var(--afast-fg); }
.sw-AT::before { content: "AF"; }
.sw-sun { background: var(--sun-bg); color: var(--accent-text); }
.sw-sun::before { content: "D"; }
.opt-input { display: inline-flex; align-items: center; gap: 8px; }
.opt-input input { width: 104px; height: 34px; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.dept-limits input.dept-limit, .dept-limits input.dept-min { width: 120px; height: 36px; font-family: var(--font-display); font-size: 15px; font-weight: 700; }
/* Abas segmentadas: ativa em texto forte com sublinhado vermelho */
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.segmented button {
  height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2);
}
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 23, 28, .14), inset 0 -2px 0 var(--accent-mark); }

/* ---------- Escala: grade ---------- */
.grid-wrap { overflow: auto; max-height: calc(100vh - var(--topbar-h) - 140px); min-height: 260px; }
/* Os dias ocupam toda a largura disponível; abaixo da largura mínima a grade rola na horizontal. */
.grid { --name-w: 228px; --day-w: 104px; width: 100%; min-width: calc(var(--name-w) + 7 * var(--day-w)); border-collapse: separate; border-spacing: 0; user-select: none; font-family: var(--font-body); font-size: 14px; table-layout: fixed; }
.grid th, .grid td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; padding: 0; }
.grid th:last-child, .grid td:last-child { border-right: 0; }
.grid tbody tr:last-child > * { border-bottom: 0; }
/* Cabeçalho grafite, dia da semana em maiúsculas e a data embaixo */
.grid thead th {
  position: sticky; top: 0; z-index: 3; height: 58px; background: var(--head-bg); color: var(--head-fg);
  border-right-color: var(--head-line); border-bottom: 0;
}
.dh-dow { display: block; font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--head-muted); }
.dh-date { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dh-over {
  display: block; margin: 3px auto 4px; width: fit-content; padding: 0 8px; border-radius: var(--radius-pill);
  background: var(--team-amber-100); color: var(--team-amber-800); font-size: 11px; font-weight: 700; line-height: 18px;
}
.contract-banner {
  position: fixed; top: var(--topbar-h); left: var(--sidebar-w); right: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 2px; padding: 9px 32px;
  background: var(--team-amber-100); color: var(--team-amber-800); border-bottom: 1px solid var(--team-amber-500);
  font-size: 13px; line-height: 1.4;
}
body.has-banner .container { padding-top: calc(var(--topbar-h) + 28px + 44px); }
body.auth-mode .contract-banner { display: none !important; }
.transfer-from { margin: 0; font-size: 14px; }
.emp-picker { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px 12px; margin: 0; min-width: 0; }
.emp-picker legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.ep-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 8px; }
.ep-search { flex: 1 1 220px; min-width: 0; }
.ep-count { font-size: 13px; color: var(--ink-2); }
.ep-bulk { display: inline-flex; gap: 2px; margin-left: auto; }
.ep-bulk .link { font-size: 13px; }
.ep-list { list-style: none; margin: 0; padding: 0; max-height: 248px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ep-item { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 0; border-bottom: 1px solid var(--line); }
.ep-item:last-child { border-bottom: 0; }
.ep-item.is-on { background: var(--accent-soft); }
.form-grid .ep-label { flex: 1 1 auto; min-width: 0; flex-direction: row; align-items: center; gap: 10px; padding: 9px 0 9px 10px; cursor: pointer; font-weight: 500; font-size: 14px; }
.ep-label input { width: 18px; height: 18px; flex: none; accent-color: var(--team-red-600); }
.ep-text { display: flex; flex-direction: column; min-width: 0; }
.ep-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-cnpj { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 400; }
.ep-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2); font-size: 11px; font-weight: 600; }
.ep-main { flex: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: var(--radius-pill); padding: 2px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.ep-main:hover { border-color: var(--team-red-600); color: var(--ink); }
.ep-main.is-main { background: var(--team-red-600); border-color: var(--team-red-600); color: #fff; cursor: default; }
.ep-empty { padding: 12px; color: var(--ink-2); font-size: 13px; }
.emp-picker .field-hint { margin-top: 8px; }
.emp-picker[disabled] .ep-list { opacity: .7; }
.sat-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px 14px; margin: 0; }
.sat-group legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.sat-group .field-hint { margin: 0 0 10px; }
.sat-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sat-fields input { width: 100%; }
.dh-closed {
  display: block; margin: 3px auto 4px; width: fit-content; padding: 0 8px; border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .14); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px;
}
.grid thead th.sun .dh-dow, .grid thead th.sun .dh-date { color: var(--head-red); }
.grid thead th.today { box-shadow: inset 0 3px 0 var(--accent-mark); background: #22262d; }
.grid thead th.today .dh-dow::after {
  content: "Hoje"; margin-left: 6px; padding: 1px 6px; border-radius: var(--radius-pill);
  background: var(--team-red-600); color: #fff; letter-spacing: .02em; text-transform: none; font-size: 11px;
}
.grid .name-col {
  position: sticky; left: 0; z-index: 2; background: var(--surface); text-align: left;
  width: var(--name-w); padding: 0; font-size: 14px; font-weight: 500;
  border-right: 1px solid var(--line-strong);
}
.grid thead .name-col {
  z-index: 4; padding: 0 16px; background: var(--head-bg); color: var(--head-fg); border-right-color: var(--head-line);
  font-family: var(--font-display); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

/* Nome do funcionário: abre a escolha da escala de horário */
.emp-btn {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 66px; padding: 8px 16px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.emp-btn:hover { background: var(--bg); }
.emp-btn:hover .emp-name { color: var(--accent-text); }
.emp-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--avatar-bg); color: var(--avatar-fg); font-family: var(--font-display); font-size: 12px; font-weight: 800;
}
.emp-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.emp-line { display: flex; align-items: center; gap: 4px; min-width: 0; }
.emp-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-shift { font-size: 12px; color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.emp-hours { color: var(--ink-3); font-weight: 400; }
.emp-shift.fixo { color: var(--accent-text); font-weight: 600; }
.emp-shift.none { text-decoration: underline dotted; text-underline-offset: 3px; }
.sex-dot { display: inline-block; flex: none; width: 14px; text-align: center; color: var(--ink-3); font-size: 13px; }
.sex-dot.M::before { content: "♂"; }
.sex-dot.F::before { content: "♀"; }

.cell {
  height: 66px; padding: 6px; cursor: pointer; vertical-align: middle;
  font-weight: 600; position: relative; background: var(--surface);
  transition: box-shadow .15s var(--ease);
  /* Células fora da área visível da grade não são calculadas até aparecerem (grade abre mais rápido). */
  content-visibility: auto; contain-intrinsic-size: auto 66px;
}
.cell .c-main { display: block; font-family: var(--font-display); font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.cell .c-sub { display: block; font-size: 12px; font-weight: 500; }
/* Dia de trabalho: em cima entrada–saída para almoço, embaixo volta do almoço–encerramento */
.cell .c-time { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell .c-time.out { color: var(--ink-2); font-weight: 500; }
/* Tipo do turno: abertura, fechamento ou intermediário */
.cell .c-tag {
  display: block; width: fit-content; max-width: 100%; margin: 0 auto 4px; padding: 0 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--tag-bg); color: var(--tag-fg);
}
.cell .c-tag.t-ab { background: var(--tag-ab-bg); color: var(--tag-ab-fg); }
.cell .c-tag.t-fe { background: var(--tag-fe-bg); color: var(--tag-fe-fg); }
.cell .c-tag.t-ab.t-fe { background: linear-gradient(90deg, var(--tag-ab-bg) 50%, var(--tag-bg) 50%); color: var(--ink); }
.shift-type { display: inline-flex; align-items: center; height: 22px; font-size: 12px; font-weight: 600; padding: 0 10px; border-radius: var(--radius-pill); background: var(--tag-bg); color: var(--tag-fg); white-space: nowrap; }
.shift-type.t-ab { background: var(--tag-ab-bg); color: var(--tag-ab-fg); }
.shift-type.t-fe { background: var(--tag-fe-bg); color: var(--tag-fe-fg); }
.shift-type.t-ab.t-fe { background: linear-gradient(90deg, var(--tag-ab-bg) 50%, var(--tag-bg) 50%); color: var(--ink); }

.cell .tm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 0 4px; }
.cell input.tm {
  display: block; width: 100%; min-width: 0; height: 25px; margin: 0; padding: 0 2px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 600; text-align: center; cursor: text; font-variant-numeric: tabular-nums;
}
.cell input.tm::-webkit-datetime-edit { padding: 0; }
.cell input.tm::-webkit-datetime-edit-fields-wrapper { padding: 0; }
.cell input.tm:focus { border-color: var(--team-red-600); box-shadow: 0 0 0 2px var(--accent-tint); }
.cell input.tm.custom { border-color: var(--team-red-600); color: var(--accent-text); }
.cell input.tm::-webkit-calendar-picker-indicator { display: none; }
.cell:hover, .cell:focus-within { box-shadow: inset 0 0 0 2px var(--team-red-600); z-index: 1; }
.cell.sun { background: var(--sun-bg); }
.lg.s-T { color: var(--ink-2); font-weight: 500; }
.cell.s-T { color: var(--ink); }
/* Folga: verde, com o texto "Folga" (nunca só a cor) */
.cell.s-F, .lg.s-F { background: var(--folga-bg); color: var(--folga-fg); }
.cell.s-F .c-sub { color: var(--folga-fg); }
/* Folga do banco de horas: lançada à mão; contorno tracejado verde e o texto "banco de horas" */
.cell.s-BH, .lg.s-BH { background: var(--surface); color: var(--folga-fg); }
.cell.s-BH { outline: 2px dashed var(--folga-fg); outline-offset: -6px; }
.cell.s-BH .c-sub { color: var(--folga-fg); }
.cell.s-FE, .lg.s-FE { background: var(--ferias-bg); color: var(--ferias-fg); }
.cell.s-AT, .lg.s-AT { background: var(--afast-bg); color: var(--afast-fg); }
/* Regra não atendida: âmbar com borda e ícone */
.cell.warn { box-shadow: inset 0 -3px 0 var(--warn-line); }
.cell.err { background: var(--warn-bg); color: var(--warn-fg); box-shadow: inset 0 0 0 2px var(--warn-line); font-weight: 700; }
.cell.err::after {
  content: "!"; position: absolute; top: 4px; right: 4px; width: 15px; height: 15px; border-radius: 50%;
  display: grid; place-items: center; background: var(--team-amber-500); color: #2b1b00; font-size: 10px; font-weight: 800; line-height: 1;
}
.cell.err:hover { box-shadow: inset 0 0 0 2px var(--team-red-600); }
/* Dia atual: coluna levemente destacada (horários automáticos e manuais) */
.cell.today.s-T, .cell.today.s-none { background: var(--today-bg); }
.cell.today.err { background: var(--warn-bg); }

/* ---------- Escolha da escala do funcionário ---------- */
.shift-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.shift-option {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color .15s var(--ease), background .15s var(--ease);
}
.shift-option:hover { background: var(--bg); }
.shift-option:has(input:checked) { border-color: var(--team-red-600); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent-mark); }
.shift-option input { height: auto; margin-top: 3px; accent-color: var(--team-red-600); }
.so-text { display: flex; flex-direction: column; gap: 2px; }
.so-text strong { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.so-text .muted { font-size: 13px; }

/* ---------- Configurações ---------- */
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.section-head h2 { margin: 0; }
.list-card + .list-card { margin-top: 20px; }
.rules-body { padding: 16px 20px; }
.rules-body p { margin: 10px 0 0; max-width: 72ch; }
.shifts-table td.mono { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.warn-dot {
  display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 6px; border-radius: 50%;
  background: var(--team-amber-500); color: #2b1b00; font-size: 12px; font-weight: 800; cursor: help;
}
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.form-grid input[type="time"] { font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.span-2 { grid-column: 1 / -1; }
.shift-preview { padding: 12px 16px; border-radius: var(--radius); background: var(--surface-2); border-left: 4px solid var(--line-strong); font-size: 14px; }
.shift-preview.ok { background: var(--ok-bg); border-left-color: var(--ok-line); }
.shift-preview.has-warn { background: var(--warn-bg); border-left-color: var(--warn-line); }
.preview-total strong { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.preview-warn { color: var(--warn-fg); margin-top: 4px; }
.check-group { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px 12px; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; }
.check-group legend { padding: 0 6px; font-weight: 600; font-size: 13px; }
.check-group .check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 500 !important; font-size: 14px !important; cursor: pointer; }
.check-group .check input { width: 18px; height: 18px; accent-color: var(--team-red-600); }
.check-group .field-hint { flex-basis: 100%; }
.field-block { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; max-width: 240px; margin-top: 12px; }

/* Alertas de regra (atenção) */
.alerts { padding: 20px 24px; margin-top: 20px; border-left: 4px solid var(--warn-line); }
.alerts ul { margin: 0; padding-left: 18px; columns: 2; column-gap: 36px; font-size: 14px; }
.alerts li { margin-bottom: 6px; break-inside: avoid; }
.alerts li::marker { color: var(--team-amber-500); }
.print-title { display: none; }

/* ---------- Histórico ---------- */
.logs-tools { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.logs-tools label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.logs-tools label.grow { flex: 1 1 220px; }
.logs-tools label.grow input { width: 100%; }
.logs-table td { white-space: normal; vertical-align: top; }
.logs-table td.mono { white-space: nowrap; }
.log-detail { display: block; font-weight: 400; font-size: 13px; color: var(--ink-2); }
.log-de { color: var(--ink-3); }
.logs-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }

/* ---------- Modal e avisos ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(21, 24, 29, .55); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal {
  background: var(--surface); color: var(--ink); border-radius: var(--radius-lg); width: min(720px, 100%);
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-modal);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.modal-head h2, .modal-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.modal-head .icon-btn { border: 0; }
.modal-body { padding: 20px 24px; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--bg); }
.radio-list { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.radio-list label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.radio-list input { height: auto; accent-color: var(--team-red-600); }

.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(420px, calc(100vw - 40px)); }
.toast {
  padding: 12px 16px; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-left: 4px solid var(--ink-3); box-shadow: var(--shadow-pop); font-size: 14px;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.success { border-left-color: var(--ok-line); }
.toast.error { border-left-color: var(--team-red-600); }
.toast.hide { opacity: 0; transform: translateY(6px); }

/* ---------- Login ---------- */
#auth-root { display: none; }
body.auth-mode { background: #ffffff; color-scheme: light; }
body.auth-mode #auth-root { display: block; }
body.auth-mode .sidebar, body.auth-mode .topbar, body.auth-mode .sidebar-backdrop, body.auth-mode #view { display: none !important; }
.auth { display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; min-height: 100vh; }
/* Painel grafite: logo e textos centralizados; a marca de desenvolvimento fica embaixo, no centro */
.auth-side {
  position: relative; background: var(--team-graphite); color: #fff; padding: 200px 48px 120px;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 48px;
  text-align: center; border-right: 4px solid var(--team-red);
}
.auth-logo { position: absolute; top: 56px; left: 50%; transform: translateX(-50%); width: min(200px, 60%); height: auto; display: block; }
.auth-copy { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.auth-copy::before { content: ""; width: 40px; height: 3px; border-radius: 2px; background: var(--team-red); }
.auth-name { font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.15; letter-spacing: -.02em; margin: 0; }
.auth-side .dev-mark {
  position: absolute; left: 0; right: 0; bottom: 40px;
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0; color: var(--team-on-dark-muted);
}
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: var(--surface); }
.auth-form { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; }
.auth-mobile-logo { display: none; align-self: flex-start; height: 28px; width: auto; margin-bottom: 8px; }
.auth-form h1 { font-size: 32px; }
.auth-form > p { margin: 0; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.auth-form input { height: 44px; font-size: 15px; }
.auth-submit { height: 44px; font-size: 15px; margin-top: 4px; }

/* ---------- Escala mensal impressa (só aparece na impressão) ---------- */
#print-root { display: none; }
.pm { color: #000; font-family: var(--font-body); }
.pm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 3mm; padding-bottom: 2mm; border-bottom: 0.8mm solid #ea2016; }
.pm-brand { display: flex; align-items: flex-end; gap: 5mm; }
.pm-logo { height: 8mm; width: auto; display: block; }
.pm-head h1 { font-family: var(--font-display); font-weight: 800; font-size: 16pt; line-height: 1.1; margin: 0; letter-spacing: 0; color: #14171c; }
.pm-head p { margin: 1mm 0 0; font-size: 9pt; }
.pm-meta { text-align: right; color: #444; }
.pm-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 7.5pt; }
.pm-table col.c-name { width: 44mm; }
.pm-table col.c-assina { width: 42mm; }
.pm-table col.c-total { width: 11mm; }
.pm-table th, .pm-table td { border: 0.3mm solid #b9bec6; padding: 0.6mm 0.8mm; text-align: center; vertical-align: middle; }
.pm-table thead th { background: #15181d; color: #fff; font-family: var(--font-display); font-weight: 700; border-color: #3a404a; }
.pm-table thead { display: table-header-group; }
.pm-table tr { break-inside: avoid; page-break-inside: avoid; }
.pm-table .pm-name { text-align: left; }
.pm-name strong { display: block; font-size: 7.8pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-name span { display: block; font-size: 6.5pt; color: #444; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-table thead .pm-name span { color: #c9ced6; }
.pm-table th.pm-d { font-size: 8pt; padding: 0.4mm 0; }
.pm-table th.pm-dow { font-size: 6.5pt; font-weight: 700; }
.pm-table td.pm-d { font-family: var(--font-display); font-weight: 700; padding: 0; height: 6.2mm; }
.pm-table .sun { background: #fff6f5; }
.pm-table thead th.sun { background: #15181d; color: #ff4a42; }
.pm-table td.v-T { color: #555; font-weight: 500; }
.pm-table td.v-F { background: #e5f4ec; color: #0f6e48; font-weight: 800; font-size: 6pt; }
.pm-table td.v-BH { background: #ffffff; color: #0f6e48; font-weight: 800; box-shadow: inset 0 0 0 0.4mm #0f6e48; }
.pm-table td.v-FE { background: #f1f2f4; color: #5b6472; }
.pm-table td.v-AT { background: #e9ebee; color: #3f4652; }
.pm-table td.pm-total { font-family: var(--font-display); font-weight: 800; font-size: 8.5pt; background: #fff6f5; }
/* Assinatura do funcionário: um X e espaço para assinar em cada linha */
.pm-table th.pm-assina { font-size: 7.5pt; }
.pm-table td.pm-assina { height: 8mm; padding: 0 1.5mm 0.8mm; text-align: left; vertical-align: bottom; }
.pm-table td.pm-assina span { font-family: var(--font-display); font-weight: 800; font-size: 9pt; color: #14171c; }
.pm-table td.v-T.ab { background: #fdeceb; color: #c8170f; font-weight: 800; }
.pm-table td.v-T.fe { background: #e3e6ea; color: #14171c; font-weight: 800; }
.pm-codes { list-style: none; margin: 2mm 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1mm 6mm; font-size: 7.5pt; }
.pm-codes li { padding: 0.3mm 1.5mm; border-radius: 1mm; }
.pm-codes li.ab { background: #fdeceb; color: #c8170f; }
.pm-codes li.fe { background: #e3e6ea; color: #14171c; }
.pm-legend { font-size: 7.5pt; margin: 2mm 0 0; }
.pm-adjust { font-size: 7pt; margin-top: 2mm; }
.pm-adjust ul { margin: 1mm 0 0; padding-left: 4mm; columns: 3; column-gap: 6mm; }
.pm-sign { display: flex; gap: 20mm; margin-top: 12mm; font-size: 8pt; break-inside: avoid; }
.pm-sign span { flex: 0 0 70mm; border-top: 0.3mm solid #000; padding-top: 1mm; }
.pm-sign span:last-child { flex-basis: 40mm; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .layout-2 { grid-template-columns: 1fr; }
  .form { position: static; }
  .alerts ul { columns: 1; }
  .legend { margin-left: 0; }
  .brand-sub { max-width: 24ch; }
}
/* Em telas menores o menu lateral vira gaveta. */
@media (max-width: 960px) {
  :root { --topbar-h: 60px; }
  .topbar { padding: 0 12px; gap: 8px; }
  .menu-toggle { display: inline-grid; }
  .brand-text { display: none; }
  .brand-logo { height: 24px; }
  .user-info, .user-chevron { display: none; }
  .user-trigger { padding: 0 4px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: none; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-modal); }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 25; background: rgba(21, 24, 29, .55); }
  .container { margin-left: 0; padding: calc(var(--topbar-h) + 20px) 20px 32px; }
  .contract-banner { left: 0; padding: 8px 20px; }
  body.has-banner .container { padding-top: calc(var(--topbar-h) + 20px + 64px); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .grid-wrap { max-height: calc(100vh - var(--topbar-h) - 120px); }
  h1 { font-size: 26px; }
}
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; min-height: 100vh; }
  .auth-side { display: none; }
  .auth-main { padding: 40px 16px; place-items: start center; }
  .auth-mobile-logo { display: block; }
}
@media (max-width: 640px) {
  .container { padding: calc(var(--topbar-h) + 16px) 16px 28px; }
  .grid { --name-w: 168px; --day-w: 96px; }
  .emp-avatar { display: none; }
  .options-bar { gap: 12px; }
  .opt-end { margin-left: 0; }
  .row-2, .form-grid { grid-template-columns: 1fr; }
  .toolbar input[type="search"] { width: 100%; }
  .toolbar .tool-group:first-child { flex: 1 1 100%; }
  .week-nav { width: 100%; }
  .week-nav input[type="date"] { flex: 1; width: auto; }
  .kpi { padding: 12px 14px; }
  .kpi-num { font-size: 26px; }
  .page-head .actions { width: 100%; }
}

/* ---------- Impressão (sempre clara) ---------- */
@media print {
  .cell { content-visibility: visible; }
  @page { size: A4 landscape; margin: 8mm; }
  /* :not(#impressao) eleva a especificidade acima das regras do tema escuro. */
  :root:not(#impressao) {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #f1f2f4; --line: #cfd3d9; --line-strong: #9aa1ab;
    --ink: #000; --ink-2: #333; --ink-3: #555;
    --head-bg: #15181d; --head-fg: #fff; --head-muted: #c9ced6; --head-red: #ff4a42;
    --folga-bg: #e5f4ec; --folga-fg: #0f6e48; --sun-bg: #fff6f5;
    --ferias-bg: #f1f2f4; --ferias-fg: #5b6472; --afast-bg: #e9ebee; --afast-fg: #3f4652;
    --tag-ab-bg: #fdeceb; --tag-ab-fg: #c8170f; --tag-fe-bg: #15181d; --tag-fe-fg: #fff; --tag-bg: #f1f2f4; --tag-fg: #5b6472;
    --warn-bg: #fef3c7; --warn-fg: #92400e; --today-bg: #fff;
  }
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .sidebar-backdrop, .page-head, .week-head, .toolbar, .options-bar, .status-line, .alerts, .toasts { display: none !important; }
  .cell input.tm { border: 0; height: 16px; font-size: 12px; color: #000; }
  .container { padding: 0; margin: 0; max-width: none; }
  .print-title { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 800; margin-bottom: 6px; }
  .card { border: 0; box-shadow: none; }
  .grid-wrap { overflow: visible; max-height: none; width: auto; }
  .grid { width: 100%; min-width: 0; font-size: 12px; }
  .cell .c-time { font-size: 12px; }
  .grid thead th, .grid .name-col { position: static; }
  .grid .name-col { width: 200px; }
  .emp-btn { min-height: 0; padding: 4px 8px; }
  .cell { height: 40px; }
  .cell .c-main { font-size: 13px; }
  .cell.err, .cell.warn { box-shadow: none; }
  .cell.err::after { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Escala mensal: no lugar da tela, imprime só a folha do mês. */
  body.printing-month #view { display: none !important; }
  body.printing-month #print-root { display: block; }
}

/* ---------- Termo aditivo (janela e impressão) ---------- */
.ad-avisos { border: 1px solid var(--team-amber-500); background: var(--team-amber-100); color: var(--team-amber-800); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }
.ad-avisos ul { margin: 4px 0 0; padding-left: 18px; }
.csv-periodo .check { flex-basis: 100%; }
.ad-doc { font-family: var(--font-body); color: #000; }
/* Cabe numa folha A4 (margens de 12 x 15 mm). */
.ad-page { font-size: 9pt; line-height: 1.27; }
.ad-page h1 { font-family: var(--font-display); font-size: 12pt; text-transform: uppercase; text-align: center; margin: 0 0 8pt; letter-spacing: .02em; }
.ad-page h2 { font-family: var(--font-display); font-size: 9pt; text-transform: uppercase; margin: 6pt 0 2pt; }
.ad-page p { margin: 0 0 3pt; text-align: justify; }
.ad-dias { margin: 0 0 3pt; padding-left: 16pt; }
.ad-dias li { margin: 0; }
.ad-local { margin-top: 8pt !important; }
.ad-assin { display: grid; grid-template-columns: 1fr 1fr; gap: 18pt 32pt; margin-top: 18pt; break-inside: avoid; }
.ad-assin div { display: flex; flex-direction: column; gap: 1pt; font-size: 8.5pt; }
.ad-linha { border-top: 1px solid #000; margin-bottom: 3pt; }

@media print {
  @page aditivo { size: A4 portrait; margin: 12mm 15mm; }
  body.printing-aditivo #view, body.printing-aditivo .contract-banner { display: none !important; }
  body.printing-aditivo #print-root { display: block; }
  .ad-page { page: aditivo; }
  .ad-page + .ad-page { break-before: page; }
}

/* Tema escuro no modo "Sistema": mesmas trocas pontuais do tema escuro manual */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .role-badge.r-master { background: #eceef1; color: #15181d; }
  :root:not([data-theme="light"]) .form-error { background: var(--accent-soft); border-color: #5a2522; color: #ff8a83; }
}

/* ---------- Departamentos (tela de Funcionários) ---------- */
.field-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-link {
  align-self: flex-start; padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--accent-text);
}
.field-link:hover { text-decoration: underline; }
.dept-add { display: flex; align-items: flex-end; gap: 8px; margin: 12px 0; }
.dept-add label { flex: 1; display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.dept-add input { width: 100%; }
.dept-list .empty { padding: 24px 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Afastamento (janela da escala do funcionário) ---------- */
.leave-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2);
}
.leave-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 260px; }
.leave-text strong { font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.leave-text .muted { font-size: 13px; }
.form-grid .check-line { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 14px; cursor: pointer; }
.form-grid .check-line input { width: 18px; height: 18px; margin-top: 2px; flex: none; accent-color: var(--team-red-600); }
.form-grid .check-line .field-hint { display: block; margin-top: 2px; }

/* ---------- Login sempre no tema claro ----------
   A tela de entrada usa as cores claras mesmo quando o sistema está no tema escuro. */
.auth {
  color-scheme: light;
  --bg: var(--team-bg);
  --surface: var(--team-surface);
  --surface-2: var(--team-bg-2);
  --line: var(--team-line);
  --line-strong: #cdd2d9;
  --ink: var(--team-ink);
  --ink-2: var(--team-muted);
  --ink-3: var(--team-subtle);
  --accent-text: var(--team-red-700);
  --accent-soft: var(--team-red-50);
  --accent-tint: var(--team-red-100);
  --danger: var(--team-red-700);
  --ok-bg: var(--team-green-100);
  --ok-fg: var(--team-green-700);
  --focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px var(--team-red-600);
  background: var(--surface);
  color: var(--ink);
}
:root .auth .form-error { background: var(--team-red-50); border-color: #f6c9c6; color: var(--team-red-700); }

/* ---------- Horário de funcionamento (Configurações) ---------- */
.hours-table td { vertical-align: middle; }
.hours-table input[type="time"] { width: 130px; font-family: var(--font-display); font-weight: 700; }
.hours-table tr.is-closed td:not(:last-child) { color: var(--ink-3); }
.hours-table tr.is-closed input[type="time"] { opacity: .45; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check-inline input { width: 18px; height: 18px; accent-color: var(--team-red-600); }
.hours-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); }
.hours-foot .form-error { flex: 1 1 280px; }

/* ---------- Cobertura do horário (Escala da semana) ---------- */
.coverage { margin-top: 20px; }
.coverage.has-gaps { border-left: 4px solid var(--warn-line); }
.cov-ok { margin: 0; color: var(--ok-fg); font-weight: 600; }
.cov-ok::before { content: "✓ "; }
.cov-list { margin: 0 0 8px; padding-left: 18px; font-size: 14px; }
.cov-list li { margin-bottom: 6px; }
.cov-list li::marker { color: var(--team-amber-500); }
.cov-setor { padding: 14px 0; border-top: 1px solid var(--line); }
.cov-setor h3 { font-size: 16px; margin-bottom: 6px; }
.cov-setor p { margin: 4px 0; font-size: 14px; }
.cov-moves { margin: 4px 0 6px; padding-left: 18px; font-size: 14px; }
.cov-need { color: var(--warn-fg); }
