/* =====================================================
   Escala LED — PIB do Brasil
   ===================================================== */
:root, [data-theme="light"] {
  --bg: #f5f6f8;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --line: #e7e9ee;
  --line-2: #d8dce4;
  --text: #1b1e25;
  --text-2: #464c59;
  --muted: #6b7280;
  --accent: #3b5bdb;
  --accent-strong: #3049b8;
  --accent-ink: #ffffff;
  --accent-tint: #eef2fd;
  --accent-line: #cdd7f7;
  --prio: #b45309;
  --prio-tint: #fdf2e3;
  --warn: #a16207;
  --warn-tint: #fdf8e6;
  --danger: #c0392b;
  --danger-tint: #fdeeec;
  --ok: #15803d;
  --ok-tint: #eaf6ef;
  --info: #2563eb;
  --info-tint: #edf3fe;
  --shadow: 0 1px 2px rgba(20, 24, 40, .04), 0 4px 16px rgba(20, 24, 40, .04);
  --radius: 14px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #131519;
  --bg-2: #171a1f;
  --surface: #1c1f25;
  --surface-2: #21252c;
  --surface-3: #2a2f38;
  --line: #2b3039;
  --line-2: #373d48;
  --text: #e6e8ec;
  --text-2: #b8bec9;
  --muted: #8b93a1;
  --accent: #8ea6ee;
  --accent-strong: #a6b9f3;
  --accent-ink: #131722;
  --accent-tint: rgba(142, 166, 238, .12);
  --accent-line: rgba(142, 166, 238, .32);
  --prio: #e9b271;
  --prio-tint: rgba(233, 178, 113, .13);
  --warn: #e3c16f;
  --warn-tint: rgba(227, 193, 111, .12);
  --danger: #ec8c84;
  --danger-tint: rgba(236, 140, 132, .12);
  --ok: #7fcf9b;
  --ok-tint: rgba(127, 207, 155, .12);
  --info: #8ab4f8;
  --info-tint: rgba(138, 180, 248, .12);
  --shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 6px 20px rgba(0, 0, 0, .18);
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px; line-height: 1.5;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .display { font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 30px; font-weight: 700; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.ic { width: 18px; height: 18px; flex-shrink: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Estrutura ---------- */
.app { display: flex; min-height: 100vh; }
.side {
  width: 264px; flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: var(--bg-2); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 18px; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 14px; border-bottom: 1px solid var(--line); }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-txt strong { font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 18px; }
.brand-txt span { font-size: 12px; color: var(--muted); }
.logo { width: 44px; height: 44px; object-fit: contain; border-radius: 12px; flex-shrink: 0; }
.logo.sm { width: 30px; height: 30px; border-radius: 8px; }
.logo.lg { width: 64px; height: 64px; border-radius: 16px; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink); font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-weight: 800; font-size: 14px; letter-spacing: .02em;
}
.logo.sm.logo-mark { font-size: 10px; }
.logo.lg.logo-mark { font-size: 20px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav-sec { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 500; text-decoration: none; min-height: 42px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--accent-tint); color: var(--accent); }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.me { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.me-txt { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.me-txt strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt span { font-size: 12px; color: var(--muted); }
.side-actions { display: flex; gap: 8px; }
.side-actions > * { flex: 1; justify-content: center; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 32px 40px 60px; max-width: 1560px; width: 100%; }
.topbar { display: none; }
.scrim { display: none; }

@media (max-width: 960px) {
  .side { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
  .topbar {
    display: flex; align-items: center; gap: 12px; padding: 10px 16px; position: sticky; top: 0; z-index: 20;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
  }
  .topbar-brand { display: flex; align-items: center; gap: 10px; font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; }
  .content { padding: 20px 16px 48px; }
  h1 { font-size: 24px; }
}

/* ---------- Componentes ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.stat { display: flex; flex-direction: column; gap: 6px; }
.stat .lbl { font-size: 13px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.stat .val { font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 34px; font-weight: 700; line-height: 1.1; }
.stat .val small { font-size: 17px; color: var(--muted); font-weight: 600; }
.stat .foot { font-size: 13px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .3s; }

.btn, .btn-ghost, .btn-outline, .btn-danger, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 10px; font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; border: 1px solid transparent; text-decoration: none !important; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent-line); }
.btn-outline:hover { background: var(--accent-tint); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger-tint); }
.btn-danger:hover { background: var(--danger-tint); }
.btn-icon { width: 44px; padding: 0; background: var(--surface-2); border-color: var(--line); color: var(--text); }
.btn-icon:hover { background: var(--surface-3); }
.sm { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn-icon.sm { width: 36px; padding: 0; }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-muted { background: var(--surface-3); color: var(--text-2); }
.badge-info { background: var(--info-tint); color: var(--info); }
.badge-warn { background: var(--warn-tint); color: var(--warn); }
.badge-ok { background: var(--ok-tint); color: var(--ok); }
.badge-prio { background: var(--prio-tint); color: var(--prio); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-accent { background: var(--accent-tint); color: var(--accent); }

.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; border: 1px solid transparent; }
.alert-ok { background: var(--ok-tint); color: var(--ok); }
.alert-erro { background: var(--danger-tint); color: var(--danger); }
.alert-info { background: var(--info-tint); color: var(--info); }
.alert-warn { background: var(--warn-tint); color: var(--warn); }

.av {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); color: var(--text-2); font-size: 13px; font-weight: 700;
}
.av.prio { background: var(--prio-tint); color: var(--prio); }

/* ---------- Formulários ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .lbl-strong { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: inherit; font-size: 15px;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.row-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
@media (max-width: 640px) { .row-fields { grid-template-columns: 1fr; } }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.person { display: flex; align-items: center; gap: 12px; }
.person strong { display: block; }
.person span { font-size: 12px; color: var(--muted); }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .display { font-size: 20px; color: var(--text); margin-bottom: 6px; }

/* ---------- Lista de cultos / escalas ---------- */
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: none; }
.date-chip {
  width: 54px; flex-shrink: 0; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 6px 0; line-height: 1.1;
}
.date-chip b { font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 22px; }
.date-chip span { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.date-chip.on { background: var(--accent-tint); border-color: var(--accent-line); }
.date-chip.on b, .date-chip.on span { color: var(--accent); }
.li-main { flex: 1; min-width: 0; }
.li-main strong { display: block; }
.li-main span { font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 99px; background: var(--surface-3); font-size: 13px; font-weight: 500; }
.chip.me { background: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* ---------- Grade de escala (líder) ---------- */
.escala-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0 14px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.legend > span { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 16px; height: 16px; border-radius: 5px; display: inline-block; }
.sw-av { background: var(--accent-tint); border: 1px solid var(--accent-line); }
.sw-as { background: var(--accent); }
.sw-full { border: 1px dashed var(--line-2); background: var(--surface-2); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters input[type=text] { width: 220px; min-height: 38px; padding: 6px 12px; font-size: 14px; }

.grade-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: calc(100vh - 150px); box-shadow: var(--shadow); }
table.grade { border-collapse: separate; border-spacing: 0; min-width: 100%; }
.grade th, .grade td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 0; }
.grade thead th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); }
.grade tfoot td { position: sticky; bottom: 0; z-index: 3; background: var(--surface-2); border-top: 1px solid var(--line-2); }
.grade .col-p { position: sticky; left: 0; z-index: 2; background: var(--surface); border-left: none; min-width: 240px; max-width: 260px; }
.grade thead .col-p, .grade tfoot .col-p { z-index: 4; background: var(--surface-2); }
.grade tr.sep td { background: var(--bg-2); }
.gh { padding: 10px 6px !important; text-align: center; min-width: 96px; }
.gh .wd { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gh .dn { font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; }
.gh .sb { font-size: 12px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; margin: 0 auto; }
.gh .mt { font-size: 11px; color: var(--muted); }
.gh.ev .sb { color: var(--prio); font-weight: 600; }
.gh.dom { background: color-mix(in srgb, var(--surface-2) 85%, var(--accent) 15%) !important; }
.gp { display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.gp .nm { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp .mt { font-size: 12px; color: var(--muted); }
.gp .obs { font-size: 12px; color: var(--warn); cursor: help; }
.gc { padding: 5px !important; }
.cell {
  width: 100%; min-height: 42px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  font: inherit; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--muted);
}
.cell.c-none { color: var(--line-2); cursor: pointer; }
.cell.c-none:hover { background: var(--surface-2); color: var(--muted); }
button.cell { cursor: pointer; }
.cell.c-av { background: var(--accent-tint); border-color: var(--accent-line); color: var(--accent); }
.cell.c-av:hover { border-color: var(--accent); }
.cell.c-as { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cell.c-full { background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--muted); cursor: not-allowed; }
.cell.c-busy { opacity: .5; }
.gt { text-align: center; min-width: 76px; }
.cnt { display: inline-flex; min-width: 34px; height: 30px; padding: 0 8px; border-radius: 8px; align-items: center; justify-content: center; font-weight: 700; background: var(--surface-3); color: var(--text-2); }
.cnt.ok { background: var(--accent-tint); color: var(--accent); }
.cnt.over { background: var(--prio-tint); color: var(--prio); }
.gf { padding: 10px 6px !important; text-align: center; }
.gf .fl { font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 18px; font-weight: 700; }
.gf .badge { font-size: 11px; padding: 2px 8px; }
.gp.pend .nm { color: var(--muted); }

/* ---------- Calendário (assessor) ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); padding: 4px 0; }
.cal .d { min-height: 64px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 8px 2px; font-size: 15px; color: var(--muted); opacity: .55; }
.cal .d.culto { opacity: 1; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.cal .d .n { font-weight: 700; font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 18px; }
.cal .d.hoje .n { color: var(--accent); }
.slots { display: flex; flex-direction: column; gap: 4px; width: 100%; padding: 4px 4px 0; }
.slot {
  min-height: 34px; border-radius: 8px; border: 1.5px solid var(--accent-line); background: transparent; color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 4px; line-height: 1.15;
}
.slot:hover { border-color: var(--accent); }
.slot[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot.ev { border-color: var(--prio); }
.slot.ev[aria-pressed="true"] { background: var(--prio); border-color: var(--prio); color: #fff; }
.slot:disabled { cursor: not-allowed; opacity: .7; }
@media (max-width: 640px) {
  .cal { gap: 3px; }
  .cal .d { min-height: 54px; padding: 6px 1px; }
  .slot { font-size: 10px; min-height: 30px; padding: 1px; }
}
.pills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pill { min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(to top, var(--bg) 70%, transparent); padding: 16px 0 8px; margin-top: 8px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Login ---------- */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; position: relative; overflow-x: hidden; }
.auth-glow { position: fixed; inset: -20% -10% auto; height: 70vh; background: radial-gradient(closest-side, var(--accent-tint), transparent); pointer-events: none; }
.auth-wrap { width: 100%; max-width: 420px; position: relative; display: flex; flex-direction: column; gap: 22px; }
.auth-brand { display: flex; align-items: center; gap: 16px; }
.auth-brand strong { display: block; font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 26px; line-height: 1.1; }
.auth-brand span { font-size: 13px; color: var(--muted); }
.auth-card { padding: 28px; }
.auth-card h1 { font-size: 24px; margin-bottom: 6px; }
.auth-card p.lead { color: var(--muted); margin: 0 0 22px; }
.auth-links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 14px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 10px; font-weight: 600; font-size: 14px; transition: all .2s; z-index: 100; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.erro { background: var(--danger); color: #fff; }

/* ---------- Modal ---------- */
dialog.modal { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(0,0,0,.55); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Impressão ---------- */
@media print {
  .side, .topbar, .no-print, .escala-toolbar, .page-head .actions { display: none !important; }
  body { background: #fff; color: #000; }
  .content { padding: 0; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ---------- Etapas do mês ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
.steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.steps .dot { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); flex-shrink: 0; }
.steps .dot .ic { width: 14px; height: 14px; }
.steps li.done { color: var(--text-2); }
.steps li.done .dot { background: var(--accent-tint); color: var(--accent); }
.steps li.cur { color: var(--text); border-color: var(--accent-line); background: var(--accent-tint); }
.steps li.cur .dot { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 800px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sel-title { width: auto; min-height: 0; border: none; background: transparent; padding: 0 28px 0 0; font-family: 'Plus Jakarta Sans', 'IBM Plex Sans', system-ui, sans-serif; font-size: 30px; font-weight: 700; color: var(--text); cursor: pointer; }
.sel-title:focus { box-shadow: none; }
.sel-title option { font-size: 15px; font-family: 'IBM Plex Sans', sans-serif; background: var(--surface); }
@media (max-width: 960px) { .sel-title { font-size: 24px; } }

/* ---------- Checkbox/radio estilizados ---------- */
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.slot { display: flex; align-items: center; justify-content: center; text-align: center; position: relative; user-select: none; }
.slot:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.slot.ev:has(input:checked) { background: var(--prio); border-color: var(--prio); color: #fff; }
.slot:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.slot:has(input:disabled) { cursor: default; opacity: .8; }
.pill-l { display: block; cursor: pointer; }
.pill-l .pill { display: flex; align-items: center; justify-content: center; width: 100%; }
.pill-l input:checked + .pill { background: var(--text); color: var(--bg); border-color: var(--text); }
.pill-l input:focus-visible + .pill { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .pills { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hero-card { background: linear-gradient(135deg, var(--accent-tint), transparent 60%), var(--surface); border-color: var(--accent-line); }
.grid > .card + .card, .split > .card + .card, .grid > form.card + form.card { margin-top: 0; }
.cal .dw { display: none; }
@media (max-width: 640px) {
  .cal { display: flex; flex-direction: column; gap: 8px; }
  .cal > .wd, .cal > div:not(.culto) { display: none; }
  .cal .d.culto { flex-direction: row; align-items: center; min-height: 60px; padding: 8px 10px 8px 14px; gap: 12px; }
  .cal .d .n { width: 52px; flex-shrink: 0; display: flex; flex-direction: column; line-height: 1.1; font-size: 22px; }
  .cal .dw { display: block; font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
  .slots { flex-direction: row; padding: 0; flex: 1; gap: 8px; }
  .slot { flex: 1; font-size: 14px; min-height: 44px; padding: 4px 8px; }
}
/* Logo em imagem: fundo branco para funcionar com logo escuro ou claro */
img.logo.logo-escuro { background: #fff; padding: 4px; }
img.logo.logo-escuro.lg { padding: 6px; }
[data-theme="light"] img.logo.logo-claro, :root:not([data-theme]) img.logo.logo-claro { background: #1b1e25; padding: 4px; }

/* ---------- Seletor de visualização ---------- */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: none; background: transparent; color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; padding: 0 14px; min-height: 38px; border-radius: 8px; cursor: pointer; }
.seg button .ic { width: 16px; height: 16px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- Calendário do mês (escala) ---------- */
.mcal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.mcal-wd { background: var(--surface-2); padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.mcal-day { background: var(--surface); min-height: 120px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mcal-day.vazio { background: var(--surface-2); }
.mcal-day:not(.tem):not(.vazio) .mcal-dn { color: var(--muted); }
.mcal-dn { display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 15px; padding: 2px 4px; }
.mcal-dn em { display: none; font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.mcal-day.hoje .mcal-dn span { background: var(--accent); color: var(--accent-ink); border-radius: 99px; min-width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.mc-culto { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 5px; background: var(--surface); }
.mc-culto.st-ok { border-left-color: var(--ok); }
.mc-culto.st-falta { border-left-color: var(--accent); }
.mc-culto.st-semgente { border-left-color: var(--prio); }
.mc-culto.ev { background: var(--prio-tint); }
.mc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.mc-t { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-t small { font-weight: 500; color: var(--muted); }
.mc-n { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.st-ok .mc-n { color: var(--ok); }
.mc-pessoas { display: flex; flex-direction: column; gap: 3px; }
.mc-p { display: flex; align-items: center; justify-content: space-between; gap: 4px; border: none; background: var(--accent-tint); color: var(--text); font: inherit; font-size: 12px; font-weight: 500; padding: 4px 6px; border-radius: 6px; cursor: pointer; text-align: left; min-height: 26px; }
.mc-p > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-p .fn { flex-shrink: 0; }
.mc-p .ic { display: none; flex-shrink: 0; color: var(--danger); }
.mc-p:hover { background: var(--danger-tint); }
.mc-p:hover .ic, .mc-p:focus-visible .ic { display: block; }
.mc-p:hover .fn, .mc-p:focus-visible .fn { display: none; }
.mc-add { display: flex; align-items: center; justify-content: center; gap: 4px; border: 1px dashed var(--line-2); background: transparent; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; border-radius: 6px; min-height: 28px; cursor: pointer; }
.mc-add span { color: var(--muted); font-weight: 500; }
.mc-add:hover { border-color: var(--accent); background: var(--accent-tint); }
.mc-add.mc-edit { color: var(--muted); border-style: solid; border-color: transparent; }
.mc-add.mc-edit:hover { color: var(--accent); }
.mc-nome { font-size: 12px; padding: 3px 6px; border-radius: 6px; background: var(--surface-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-nome.me { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.mc-vazio { font-size: 12px; color: var(--muted); font-style: italic; }
@media (max-width: 900px) {
  .mcal { display: flex; flex-direction: column; background: transparent; border: none; gap: 8px; overflow: visible; }
  .mcal-wd, .mcal-day.vazio, .mcal-day:not(.tem) { display: none; }
  .mcal-day { border: 1px solid var(--line); border-radius: 12px; min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: flex-start; padding: 10px; }
  .mcal-dn { width: 56px; flex-direction: column; gap: 0; font-size: 20px; line-height: 1.1; }
  .mcal-dn em { display: block; }
  .mc-culto { flex: 1 1 200px; }
  .mc-p .ic { display: block; }
}

/* ---------- Modal de escolha ---------- */
.modal-pick { width: min(560px, calc(100vw - 32px)); }
.modal-pick .modal-body { max-height: min(60vh, 560px); overflow-y: auto; padding: 8px 18px 14px; }
.pk-sec { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 4px 6px; }
.pk-sec span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.pk-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 52px; }
.pk-row:hover:not(:disabled) { background: var(--surface-2); border-color: var(--line); }
.pk-row:disabled { opacity: .5; cursor: not-allowed; }
.pk-row.on { background: var(--accent-tint); }
.pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-main strong { font-size: 14px; }
.pk-main small { font-size: 12px; color: var(--muted); }
.pk-main small.warn { color: var(--prio); }
.pk-main small.pk-obs { font-style: italic; }
.pk-act { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.pk-row.on .pk-act { color: var(--danger); }
.pk-outros summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 4px; }
@media (max-width: 900px) {
  .mcal-day { display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 10px; row-gap: 6px; }
  .mcal-dn { grid-column: 1; grid-row: 1; width: auto; }
  .mcal-day { grid-auto-flow: row dense; row-gap: 8px; }
  .mc-culto { grid-column: 2; }
}
@media (max-width: 640px) {
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .g4 .card { padding: 14px; }
  .g4 .stat .val { font-size: 26px; }
  .g4 .stat .foot { font-size: 12px; }
}

/* ---------- Funções (tags) ---------- */
:root, [data-theme="light"] {
  --fn-lider-bg: #eef2fd; --fn-lider-tx: #3049b8; --fn-lider-dot: #3b5bdb;
  --fn-op-bg: #eaf6f2;    --fn-op-tx: #0f6b5c;    --fn-op-dot: #14a085;
  --fn-tr-bg: #fdf4e3;    --fn-tr-tx: #93570b;    --fn-tr-dot: #e0901c;
}
[data-theme="dark"] {
  --fn-lider-bg: rgba(142,166,238,.14); --fn-lider-tx: #b4c5f6; --fn-lider-dot: #8ea6ee;
  --fn-op-bg: rgba(94,200,170,.13);     --fn-op-tx: #9ddcc8;    --fn-op-dot: #5ec8aa;
  --fn-tr-bg: rgba(233,178,113,.14);    --fn-tr-tx: #efc58f;    --fn-tr-dot: #e9b271;
}
span.fn { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; line-height: 1.5; vertical-align: middle; border: none; }
span.fn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
span.fn.fn-lider { background: var(--fn-lider-bg); color: var(--fn-lider-tx); }
span.fn.fn-lider::before { background: var(--fn-lider-dot); }
span.fn.fn-operador { background: var(--fn-op-bg); color: var(--fn-op-tx); }
span.fn.fn-operador::before { background: var(--fn-op-dot); }
span.fn.fn-trainee { background: var(--fn-tr-bg); color: var(--fn-tr-tx); }
span.fn.fn-trainee::before { background: var(--fn-tr-dot); }
span.fn.fn-sm { font-size: 10px; padding: 0 6px 0 5px; gap: 4px; line-height: 17px; }
span.fn.fn-sm::before { width: 5px; height: 5px; }
.person strong span.fn { margin-left: 6px; position: relative; top: -1px; }
.mc-p .fn, .mc-nome .fn { margin-left: auto; }
.mc-nome { display: flex; align-items: center; gap: 6px; }
.mc-nome.me span.fn { background: rgba(255,255,255,.2); color: inherit; }
.mc-nome.me span.fn::before { background: currentColor; }
.mc-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-troca { font-size: 11px; font-weight: 600; padding: 2px 6px; align-self: flex-start; }
.chip .fn { margin-left: 4px; }
.chip.me span.fn { background: rgba(255,255,255,.22); color: inherit; }
.chip.me span.fn::before { background: currentColor; }

/* ---------- Menu: contador ---------- */
.nav-badge { margin-left: auto; font-style: normal; background: var(--prio); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Trocas ---------- */
.troca { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.troca + .troca { margin-top: 10px; }
.troca-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.troca-pessoas { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.troca-seta { color: var(--muted); font-size: 18px; margin: 0 4px; }
.troca-det { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.troca-acoes { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; }
