/* ==========================================================
   ESCALAS PRO — Design System
   ========================================================== */
:root {
  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-soft: #eef2ff;
  --accent: #06b6d4;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --line: #e2e8f0;
  --line-2: #eef2f6;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;

  --success: #16a34a;
  --success-soft: #dcfce7;
  --warn: #d97706;
  --warn-soft: #fef3c7;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --info: #2563eb;
  --info-soft: #dbeafe;

  --shift-m: #f59e0b;
  --shift-t: #2563eb;
  --shift-n: #7c3aed;
  --off: #94a3b8;
  --vacation: #0ea5e9;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 4px 16px rgba(16,24,40,.06);
  --shadow-lg: 0 10px 30px rgba(16,24,40,.12);
  --sidebar-w: 264px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0 0 .4em; line-height: 1.25; color: var(--ink); font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
small { color: var(--muted); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  color: #c7d2fe;
  position: fixed; inset: 0 auto 0 0;
  display: flex; flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar__brand {
  padding: 20px 22px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar__brand .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--brand));
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 12px rgba(6,182,212,.4);
}
.sidebar__brand b { color: #fff; font-size: 1.05rem; letter-spacing: .3px; }
.sidebar__brand span { display: block; font-size: 11px; color: #a5b4fc; font-weight: 500; }
.nav { padding: 14px 12px; overflow-y: auto; flex: 1; }
.nav__label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #818cf8; margin: 16px 12px 6px; font-weight: 700; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9.5px 12px; margin: 2px 0; border-radius: 10px;
  color: #c7d2fe; font-weight: 500; font-size: 14px;
  transition: all .15s; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; opacity: .85; flex-shrink: 0; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.nav a .badge-count {
  margin-left: auto; background: var(--accent); color: #04283a;
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
}

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar__title { font-weight: 700; font-size: 1.05rem; }
.topbar__spacer { flex: 1; }
.topbar__user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 6px; }
.content { padding: 24px; max-width: 1400px; width: 100%; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card__head { padding: 16px 20px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 12px; }
.card__head h3 { margin: 0; }
.card__head .spacer { flex: 1; }
.card__body { padding: 20px; }
.card__body.tight { padding: 0; }

/* ---------- KPI grid ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kpi {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.kpi__icon {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 12px;
}
.kpi__icon svg { width: 21px; height: 21px; }
.kpi__value { font-size: 1.85rem; font-weight: 800; color: var(--ink); line-height: 1; }
.kpi__label { color: var(--muted); font-size: 13px; margin-top: 5px; font-weight: 500; }
.kpi--indigo .kpi__icon { background: var(--brand-soft); color: var(--brand); }
.kpi--cyan .kpi__icon { background: #cffafe; color: #0891b2; }
.kpi--green .kpi__icon { background: var(--success-soft); color: var(--success); }
.kpi--amber .kpi__icon { background: var(--warn-soft); color: var(--warn); }
.kpi--red .kpi__icon { background: var(--danger-soft); color: var(--danger); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; cursor: pointer; transition: all .15s;
  background: var(--surface); color: var(--ink-2); border-color: var(--line);
  text-decoration: none; line-height: 1.2; white-space: nowrap;
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow); transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn--primary:hover { background: var(--brand-600); }
.btn--accent { background: var(--accent); color: #04283a; border-color: var(--accent); }
.btn--success { background: var(--success); color: #fff; border-color: var(--success); }
.btn--danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--sm { padding: 6px 11px; font-size: 13px; }
.btn--icon { padding: 7px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.input, .select, textarea, input[type=text], input[type=email], input[type=password],
input[type=date], input[type=time], input[type=number], input[type=color], select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 14px; font-family: inherit;
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
input[type=color] { padding: 4px; height: 42px; }
textarea { resize: vertical; min-height: 80px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 11px 16px; background: var(--surface-2);
  color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge--green { background: var(--success-soft); color: #15803d; }
.badge--amber { background: var(--warn-soft); color: #b45309; }
.badge--red { background: var(--danger-soft); color: #b91c1c; }
.badge--blue { background: var(--info-soft); color: #1d4ed8; }
.badge--gray { background: #f1f5f9; color: var(--muted); }
.badge--indigo { background: var(--brand-soft); color: var(--brand-700); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- Alerts / flash ---------- */
.flash-stack { position: fixed; top: 74px; right: 24px; z-index: 60; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.flash {
  padding: 13px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500;
  animation: slideIn .3s ease; background: #fff; border-left: 4px solid;
}
.flash--success { border-color: var(--success); color: #14532d; }
.flash--error { border-color: var(--danger); color: #7f1d1d; }
.flash svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.flash button { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 18px; line-height: 1; padding: 0; }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.notice--info { background: var(--info-soft); color: #1e40af; }
.notice--warn { background: var(--warn-soft); color: #92400e; }
.notice--danger { background: var(--danger-soft); color: #991b1b; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head__text h1 { margin: 0; }
.page-head__text p { margin: 3px 0 0; color: var(--muted); }
.page-head__actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Filters bar ---------- */
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { margin: 0; min-width: 150px; }

/* ---------- Schedule grid ---------- */
.schedule-scroll { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table.schedule { border-collapse: collapse; font-size: 12.5px; width: 100%; }
table.schedule th, table.schedule td { border: 1px solid var(--line-2); text-align: center; }
table.schedule thead th { background: var(--surface-2); padding: 5px 4px; font-weight: 600; position: sticky; top: 0; z-index: 5; }
table.schedule th.emp-col, table.schedule td.emp-col {
  text-align: left; padding: 7px 12px; position: sticky; left: 0; background: #fff; z-index: 4;
  min-width: 190px; max-width: 190px; box-shadow: 2px 0 4px rgba(0,0,0,.03);
}
table.schedule thead th.emp-col { z-index: 6; background: var(--surface-2); }
table.schedule td.day-cell { width: 34px; min-width: 34px; height: 34px; padding: 0; cursor: pointer; font-weight: 700; user-select: none; position: relative; }
table.schedule td.day-cell:hover { outline: 2px solid var(--brand); outline-offset: -2px; z-index: 3; }
/* Fim de semana: não sobrescrever a cor real da escala.
   Antes, a regra em td.weekend tinha especificidade maior que as classes
   de turno/status e fazia algumas células perderem o background. */
table.schedule th.weekend { background: #f1f5f9; }
table.schedule td.day-cell.weekend[data-type=""],
table.schedule td.day-cell.weekend:not([data-type]) { background: #f1f5f9; }
table.schedule td.day-cell.weekend[data-type]:not([data-type=""]) {
  box-shadow: inset 0 -2px 0 #cbd5e1;
}
table.schedule th.sunday { color: var(--danger); }
.cell-M { background: #fef3c7; color: #92400e; }
.cell-T { background: #dbeafe; color: #1e40af; }
.cell-N { background: #ede9fe; color: #5b21b6; }
.cell-FOLGA { background: #f1f5f9; color: #94a3b8; }
.cell-FERIAS { background: #cffafe; color: #0e7490; }
.cell-ATESTADO { background: #fce7f3; color: #9d174d; }
.cell-FALTA { background: #fee2e2; color: #b91c1c; }
.cell-FERIADO { background: #dcfce7; color: #166534; }
.emp-sector { font-size: 11px; color: var(--muted); font-weight: 500; }
.emp-name { font-weight: 600; color: var(--ink); font-size: 13px; }
tr.coverage-row td { background: #0f172a; color: #cbd5e1; font-weight: 700; font-size: 11px; }
tr.coverage-row td.emp-col { background: #0f172a; color: #fff; }
tr.coverage-row td.over-limit { background: #7f1d1d; color: #fecaca; }

.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend .chip { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 15px; height: 15px; border-radius: 4px; border: 1px solid rgba(0,0,0,.08); }

/* ---------- Login ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-brand {
  background: linear-gradient(140deg, #312e81 0%, #4f46e5 60%, #06b6d4 130%);
  color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-brand::after {
  content: ""; position: absolute; width: 480px; height: 480px; border-radius: 50%;
  background: rgba(255,255,255,.06); right: -160px; bottom: -160px;
}
.auth-brand .logo-lg {
  width: 60px; height: 60px; border-radius: 16px; background: rgba(255,255,255,.15);
  display: grid; place-items: center; font-weight: 800; font-size: 28px; margin-bottom: 26px;
  backdrop-filter: blur(8px);
}
.auth-brand h1 { color: #fff; font-size: 2.1rem; max-width: 420px; }
.auth-brand p { color: #c7d2fe; font-size: 1.05rem; max-width: 420px; }
.auth-brand ul { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 12px; }
.auth-brand li { display: flex; align-items: center; gap: 11px; color: #e0e7ff; font-weight: 500; }
.auth-brand li svg { width: 20px; height: 20px; color: #67e8f9; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 1.5rem; }
.auth-card > p { color: var(--muted); margin-bottom: 26px; }

/* ---------- Misc ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 240px; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.chart-box { position: relative; height: 300px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state svg { width: 54px; height: 54px; color: var(--muted-2); margin-bottom: 14px; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; }
.pagination a, .pagination span {
  padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff;
}
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-soft); color: var(--brand-700); display: grid; place-items: center; font-weight: 800; font-size: 24px; }
dl.detail { display: grid; grid-template-columns: 160px 1fr; gap: 0; }
dl.detail dt { padding: 10px 0; color: var(--muted); font-weight: 600; font-size: 13px; border-bottom: 1px solid var(--line-2); }
dl.detail dd { padding: 10px 0; margin: 0; border-bottom: 1px solid var(--line-2); }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; }
.modal__head { padding: 18px 22px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; }
.modal__head h3 { margin: 0; }
.modal__head button { margin-left: auto; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal__body { padding: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .hamburger { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
}
@media (max-width: 640px) {
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .page-head__actions { margin-left: 0; width: 100%; }
  .kpi__value { font-size: 1.5rem; }
  dl.detail { grid-template-columns: 1fr; }
  dl.detail dt { border-bottom: 0; padding-bottom: 0; }
}
.sidebar-backdrop { display: none; }
@media (max-width: 980px) {
  .sidebar-backdrop.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 39; }
}

/* ==========================================================
   v1.2 — PWA, branding e painel responsivo
   ========================================================== */
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; min-height: 100dvh; }
.content { margin: 0 auto; }

/* Ícone configurável do sistema */
.sidebar__brand .logo.logo--image,
.auth-brand .logo-lg.logo-lg--image {
  overflow: hidden;
  padding: 0;
  background: transparent;
  box-shadow: 0 4px 14px rgba(15,23,42,.25);
}
.sidebar__brand .logo.logo--image img,
.auth-brand .logo-lg.logo-lg--image img,
.auth-system-icon,
.system-icon-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.auth-system-icon {
  width: 58px;
  height: 58px;
  border-radius: 15px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.pwa-install[hidden] { display: none !important; }
.auth-install { margin-top: 10px; }

/* Configurações */
.settings-card { max-width: 860px; margin-bottom: 16px; }
.settings-actions { max-width: 860px; }
.branding-settings { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 22px; align-items: center; }
.branding-preview { display: flex; align-items: center; gap: 14px; }
.system-icon-preview { width: 72px; height: 72px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); flex: 0 0 auto; }
.branding-upload { margin: 0; }
input[type=file] {
  width: 100%; padding: 9px 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-2); font: inherit;
}
input[type=file]::file-selector-button {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 7px;
  padding: 7px 10px; margin-right: 10px; font-weight: 600; cursor: pointer;
}
.check-card {
  display: flex !important; gap: 10px; align-items: flex-start; margin-bottom: 14px; cursor: pointer;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2);
}
.check-card input { width: auto !important; margin-top: 3px; flex: 0 0 auto; }
.check-card--danger { grid-column: 1 / -1; margin: 0; border-color: #fecaca; background: #fffafa; }
.soft-rule { border: 0; border-top: 1px solid var(--line-2); margin: 16px 0; }

/* Painel */
.card-subtitle { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 500; }
.dashboard-grid { display: grid; gap: 16px; align-items: stretch; }
.dashboard-grid--top { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); margin-bottom: 16px; }
.dashboard-grid--main { grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); }
.coverage-today-card .card__head { align-items: flex-start; }
.coverage-count { margin-left: auto; white-space: nowrap; }
.coverage-today-body { padding-top: 10px; padding-bottom: 10px; max-height: 390px; overflow: auto; }
.today-workers { display: flex; flex-direction: column; }
.worker-row {
  display: grid; grid-template-columns: 38px minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 11px 0; border-bottom: 1px solid var(--line-2);
}
.worker-row:last-child { border-bottom: 0; }
.worker-avatar {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-700); font-weight: 800;
}
.worker-main { min-width: 0; }
.worker-main > strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worker-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.worker-meta span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.worker-meta svg { width: 13px; height: 13px; flex: 0 0 auto; }
.worker-shift { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 6px; text-align: right; min-width: 72px; }
.worker-shift small { grid-column: 1 / -1; }
.shift-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.alerts-scroll { max-height: 390px; overflow: auto; }
.notice--compact { padding: 10px 12px; font-size: 13px; }
.empty-state--compact { padding: 34px 14px; }
.empty-state--compact svg { width: 42px; height: 42px; }
.empty-state--compact p { margin-bottom: 0; }

/* Calendário do painel */
.calendar-card__body { padding: 14px; }
.schedule-calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.schedule-calendar__weekday {
  text-align: center; color: var(--muted); font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .04em; padding: 4px 0;
}
.schedule-calendar__blank { min-height: 72px; }
.schedule-calendar__day {
  min-width: 0; min-height: 72px; position: relative; border: 1px solid var(--line-2); border-radius: 10px;
  background: var(--surface-2); padding: 8px 7px; cursor: pointer; font: inherit; color: var(--ink);
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; transition: .15s ease;
}
.schedule-calendar__day:hover { border-color: var(--brand); background: var(--brand-soft); transform: translateY(-1px); }
.schedule-calendar__day.is-weekend { background: #fafafa; }
.schedule-calendar__day.has-workers { background: #fff; border-color: #dbe3f0; }
.schedule-calendar__day.is-today { box-shadow: inset 0 0 0 2px var(--brand); }
.schedule-calendar__number { font-size: 13px; font-weight: 800; }
.schedule-calendar__count {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800;
}
.schedule-calendar__label { font-size: 9.5px; color: var(--muted); line-height: 1; }
.schedule-calendar__empty { color: var(--muted-2); font-weight: 700; }
.modal--wide { max-width: 620px; }
.calendar-worker-list { display: flex; flex-direction: column; gap: 0; }
.calendar-worker-row {
  display: grid; grid-template-columns: 10px minmax(0,1fr) auto; gap: 12px; align-items: center;
  padding: 12px 2px; border-bottom: 1px solid var(--line-2);
}
.calendar-worker-row:last-child { border-bottom: 0; }
.calendar-worker-dot { width: 9px; height: 36px; border-radius: 999px; }
.calendar-worker-main { min-width: 0; display: flex; flex-direction: column; }
.calendar-worker-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-worker-main span { font-size: 12px; }
.calendar-worker-shift { min-width: 88px; text-align: right; display: flex; flex-direction: column; }

@media (max-width: 1180px) {
  .dashboard-grid--main { grid-template-columns: 1fr; }
  .calendar-card { order: -1; }
}

@media (max-width: 980px) {
  .sidebar { width: min(310px, 86vw); }
  .content { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
  .topbar { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .auth-form { min-height: 100vh; min-height: 100dvh; padding: max(28px, env(safe-area-inset-top)) 28px max(28px, env(safe-area-inset-bottom)); }
  .auth-card { max-width: 430px; }
  .dashboard-grid--top { grid-template-columns: 1fr; }
  .alerts-scroll, .coverage-today-body { max-height: none; }
  .branding-settings { grid-template-columns: 1fr; }
  .check-card--danger { grid-column: auto; }
}

@media (max-width: 760px) {
  h1 { font-size: 1.4rem; }
  .content { padding-top: 18px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .card__head { padding: 14px 16px; flex-wrap: wrap; }
  .card__body { padding: 16px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 16px; }
  .kpi { padding: 14px; }
  .kpi__icon { width: 36px; height: 36px; margin-bottom: 9px; }
  .kpi__value { font-size: 1.45rem; }
  .kpi__label { font-size: 11.5px; }
  .dashboard-filters { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .dashboard-filters .field { min-width: 0; width: 100%; }
  .dashboard-filters .field:first-child { grid-column: 1 / -1; }
  .chart-box { height: 250px; }
  .coverage-legend { width: 100%; justify-content: flex-start; }
  .schedule-calendar { gap: 4px; }
  .schedule-calendar__day, .schedule-calendar__blank { min-height: 62px; }
  .schedule-calendar__day { padding: 6px 5px; border-radius: 8px; }
  .schedule-calendar__count { min-width: 21px; height: 21px; font-size: 10px; }
  .schedule-calendar__label { display: none; }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: 88dvh; border-radius: 16px 16px 10px 10px; }
  .modal__head, .modal__body { padding: 16px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table.data th, table.data td { padding: 10px 12px; }
  .form-actions { position: sticky; bottom: 0; background: var(--bg); z-index: 8; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }
}

@media (max-width: 560px) {
  .topbar { height: 58px; gap: 8px; }
  .topbar__title { font-size: .96rem; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar__user a > div:first-child { display: none; }
  .topbar__user { gap: 2px; }
  .pwa-install span { display: none; }
  .pwa-install { padding: 7px; }
  .page-head { margin-bottom: 16px; }
  .page-head__actions { width: 100%; }
  .filters { width: 100%; }
  .filters .field { flex: 1 1 140px; }
  .worker-row { grid-template-columns: 34px minmax(0,1fr); gap: 10px; }
  .worker-avatar { width: 34px; height: 34px; border-radius: 10px; }
  .worker-shift { grid-column: 2; display: flex; justify-content: flex-start; align-items: center; text-align: left; min-width: 0; }
  .worker-shift small { margin-left: 4px; }
  .calendar-card__body { padding: 10px; }
  .schedule-calendar__weekday { font-size: 9px; }
  .schedule-calendar__day, .schedule-calendar__blank { min-height: 54px; }
  .schedule-calendar__day { padding: 5px 4px; }
  .schedule-calendar__number { font-size: 11px; }
  .schedule-calendar__count { min-width: 19px; height: 19px; padding: 0 4px; font-size: 9px; }
  .calendar-worker-row { grid-template-columns: 8px minmax(0,1fr); gap: 9px; }
  .calendar-worker-dot { height: 32px; }
  .calendar-worker-shift { grid-column: 2; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; min-width: 0; }
  .branding-preview { align-items: flex-start; }
  .settings-card .card__body { padding: 15px; }
  .auth-form { padding-left: 20px; padding-right: 20px; }
  .auth-card { max-width: none; }
  .auth-system-icon { width: 54px; height: 54px; }
  .flash-stack { left: 12px; right: 12px; top: 68px; max-width: none; }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .schedule-calendar__day, .schedule-calendar__blank { min-height: 48px; }
  .schedule-calendar__count { width: 18px; min-width: 18px; height: 18px; }
}
.calendar-loading { padding: 30px 12px; text-align: center; color: var(--muted); font-weight: 600; }

/* ==========================================================
   ESCALAS PRO V1.5 — Responsividade reforçada para tablet/celular
   Integrada ao app.css para evitar dependência de um segundo arquivo de estilo.
   ========================================================== */

html, body { max-width: 100%; }
body { overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
.main, .content, .card, .card__body, .card__head, .page-head, .page-head__text,
.page-head__actions, .table-wrap, .schedule-scroll, form, fieldset { min-width: 0; }
code, pre, dd, .notice, .flash { overflow-wrap: anywhere; word-break: break-word; }

/* Tablet: recolhe o menu antes de a área útil ficar apertada. */
@media (max-width: 1180px) {
  .sidebar {
    width: min(320px, 88vw);
    transform: translateX(-105%);
    padding-left: env(safe-area-inset-left);
  }
  .sidebar.open { transform: translateX(0); box-shadow: 12px 0 32px rgba(15,23,42,.22); }
  .main { margin-left: 0 !important; width: 100%; min-width: 0; }
  .hamburger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    border-radius: 10px;
    color: var(--ink-2);
  }
  .hamburger:hover { background: var(--surface-2); }
  .hamburger svg { width: 22px; height: 22px; }
  .sidebar-backdrop.open {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 39;
    background: rgba(15,23,42,.52);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  body.menu-open { overflow: hidden; touch-action: none; }

  .content {
    max-width: none;
    width: 100%;
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
  .topbar {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
  .topbar__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .form-grid { grid-template-columns: 1fr !important; }
  .dashboard-grid--top, .dashboard-grid--main { grid-template-columns: 1fr !important; }
  .dashboard-grid--main .calendar-card { order: -1; }
  .branding-settings { grid-template-columns: 1fr !important; }

  .table-wrap, .schedule-scroll {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }
}

/* Celular e tablets menores. */
@media (max-width: 768px) {
  body { font-size: 14px; }
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.15rem; }

  .topbar { height: 58px; gap: 8px; }
  .topbar__title { font-size: .95rem; flex: 0 1 auto; max-width: 42vw; }
  .topbar__spacer { min-width: 4px; }
  .topbar__user { gap: 2px; min-width: 0; }
  .topbar__user a > div:first-child { display: none; }
  .avatar { width: 34px; height: 34px; flex: 0 0 auto; }
  .pwa-install span { display: none; }
  .pwa-install { padding: 8px; min-width: 40px; min-height: 40px; }

  .content {
    padding-top: 14px;
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .page-head {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-head__text { width: 100%; }
  .page-head__text p { line-height: 1.4; }
  .page-head__actions {
    margin-left: 0 !important;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .page-head__actions > .btn,
  .page-head__actions > form,
  .page-head__actions > form > .btn { min-width: 0; width: 100%; }

  .filters,
  .dashboard-filters {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    align-items: end;
    width: 100%;
    gap: 10px;
  }
  .filters .field,
  .dashboard-filters .field {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0;
  }
  .filters > .btn { width: 100%; min-height: 42px; }
  .dashboard-filters .field:first-child { grid-column: 1 / -1; }

  input, select, textarea,
  .input, .select,
  input[type=text], input[type=email], input[type=password],
  input[type=date], input[type=time], input[type=number], input[type=color] {
    min-width: 0;
    max-width: 100%;
    font-size: 16px; /* evita zoom automático no iPhone */
  }

  .btn {
    min-height: 42px;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }
  .btn--sm { min-height: 38px; }
  .btn--icon { width: 40px; min-width: 40px; padding: 8px; }

  .card { border-radius: 12px; }
  .card__head { padding: 14px; flex-wrap: wrap; align-items: flex-start; }
  .card__body { padding: 14px; }
  .card__head .spacer { min-width: 0; }

  .row {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
  }
  .row > * {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }

  .form-grid { grid-template-columns: 1fr !important; gap: 0; }
  .form-actions {
    position: static !important;
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    gap: 8px;
    background: transparent;
    padding-bottom: 0;
  }
  .form-actions .btn { width: 100%; }

  /* Tabelas continuam completas, mas rolam dentro do card — nunca a página toda. */
  .table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 0 0 12px 12px;
    scrollbar-width: thin;
  }
  table.data {
    width: max-content;
    min-width: 100%;
    font-size: 13px;
  }
  table.data th, table.data td {
    padding: 10px 11px;
    white-space: nowrap;
  }
  table.data td .emp-sector,
  table.data td pre { white-space: normal; }
  table.data td.actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -6px 0 10px rgba(15,23,42,.04);
  }
  table.data tbody tr:hover td.actions { background: var(--surface-2); }

  .pagination {
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 8px;
  }
  .pagination a, .pagination span { flex: 0 0 auto; }

  /* Grade mensal: nome fixo mais compacto e datas roláveis por toque. */
  .schedule-scroll {
    width: 100%;
    max-width: calc(100vw - max(24px, 2 * env(safe-area-inset-left)));
    touch-action: pan-x pan-y;
  }
  table.schedule { width: max-content; min-width: 100%; }
  table.schedule th.emp-col,
  table.schedule td.emp-col {
    min-width: 150px;
    max-width: 150px;
    padding: 7px 9px;
  }
  table.schedule td.day-cell { width: 36px; min-width: 36px; height: 38px; }
  table.schedule thead th:not(.emp-col) { min-width: 36px; }
  .emp-name { font-size: 12px; white-space: normal; line-height: 1.25; }
  .emp-sector { font-size: 10px; white-space: normal; line-height: 1.25; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .kpi { padding: 13px; min-width: 0; }
  .kpi__icon { width: 34px; height: 34px; margin-bottom: 8px; }
  .kpi__value { font-size: 1.35rem; }
  .kpi__label { font-size: 11px; line-height: 1.3; }

  .worker-row { grid-template-columns: 34px minmax(0,1fr); gap: 9px; }
  .worker-avatar { width: 34px; height: 34px; }
  .worker-shift {
    grid-column: 2;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
    min-width: 0;
  }
  .worker-shift small { margin-left: 4px; }
  .worker-meta { gap: 4px 9px; }

  .calendar-card__body { padding: 9px; }
  .schedule-calendar { gap: 3px; }
  .schedule-calendar__weekday { font-size: 9px; }
  .schedule-calendar__day,
  .schedule-calendar__blank { min-height: 52px; }
  .schedule-calendar__day { padding: 5px 4px; border-radius: 7px; }
  .schedule-calendar__number { font-size: 11px; }
  .schedule-calendar__count { min-width: 19px; height: 19px; padding: 0 4px; font-size: 9px; }
  .schedule-calendar__label { display: none; }

  .chart-box { height: 240px; min-height: 220px; }
  .coverage-legend { width: 100%; justify-content: flex-start; gap: 9px; }

  dl.detail { grid-template-columns: 1fr !important; }
  dl.detail dt { padding: 9px 0 2px; border-bottom: 0; }
  dl.detail dd { padding: 0 0 10px; min-width: 0; }

  .modal-overlay {
    padding: 8px;
    align-items: flex-end;
  }
  .modal {
    width: 100%;
    max-width: none !important;
    max-height: 90dvh;
    border-radius: 16px 16px 8px 8px;
  }
  .modal__head, .modal__body { padding: 15px; }
  .modal form > .modal__body:last-child { flex-wrap: wrap; }

  .flash-stack {
    top: 66px;
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .auth-wrap { display: block; min-height: 100dvh; }
  .auth-brand { display: none !important; }
  .auth-form {
    min-height: 100dvh;
    width: 100%;
    padding: max(24px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  }
  .auth-card { width: 100%; max-width: 430px; margin: 0 auto; }

  .branding-preview { align-items: flex-start; flex-wrap: wrap; }
  .settings-card, .settings-actions { max-width: none !important; width: 100%; }

  .empty-state { padding: 32px 14px; }
  .notice { padding: 12px; }
}

@media (max-width: 520px) {
  .topbar__title { max-width: 34vw; }
  .page-head__actions { grid-template-columns: 1fr; }
  .filters, .dashboard-filters { grid-template-columns: 1fr !important; }
  .dashboard-filters .field:first-child { grid-column: auto; }
  .filters > .btn { width: 100%; }

  .kpi-grid { grid-template-columns: 1fr 1fr; }

  .modal form > .modal__body:last-child .btn {
    flex: 1 1 100%;
    width: 100%;
  }

  .coverage-count { margin-left: 0; }
  .calendar-worker-row { grid-template-columns: 8px minmax(0,1fr); }
  .calendar-worker-shift { grid-column: 2; text-align: left; align-items: flex-start; }

  .sidebar__brand { padding-top: max(18px, env(safe-area-inset-top)); }
  .nav { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .topbar__title { display: none; }
  .schedule-calendar__day, .schedule-calendar__blank { min-height: 47px; }
}

@media (hover: none) and (pointer: coarse) {
  .nav a { min-height: 44px; }
  .btn, .hamburger, .modal__head button { touch-action: manipulation; }
  table.schedule td.day-cell { min-height: 40px; }
}

/* Relatório de aniversariantes */
.birthday-day {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:34px;
  height:34px;
  padding:0 8px;
  border-radius:10px;
  background:#eef2ff;
  color:#4338ca;
  font-weight:800;
}
.birthday-empty { gap:6px; }
.birthday-empty span { color:var(--muted); max-width:680px; line-height:1.5; }

/* ===== Relatórios v1.5.5 ===== */
.report-filters-card { margin-bottom: 22px; }
.report-general-filters {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}
.report-filter-hint { margin-top:10px; }
.reports-heading { margin: 26px 0 14px; display:flex; justify-content:space-between; align-items:flex-end; gap:16px; }
.reports-heading h2 { margin:0; font-size:1.15rem; }
.reports-heading p { margin:5px 0 0; color:var(--muted); font-size:13px; }
.report-catalog { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.report-option-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:20px;
  box-shadow:var(--shadow-sm);
  display:flex;
  flex-direction:column;
  min-height:230px;
}
.report-option-icon {
  width:46px; height:46px; border-radius:14px;
  display:grid; place-items:center;
  background:#eef2ff; color:#4338ca;
  margin-bottom:16px;
}
.report-option-icon svg { width:22px; height:22px; }
.report-option-content { flex:1; }
.report-option-content h3 { margin:0 0 8px; font-size:1rem; }
.report-option-content p { margin:0; color:var(--muted); font-size:13px; line-height:1.55; }
.report-option-action { margin-top:18px; width:100%; justify-content:center; }

.report-actions {
  display:flex; align-items:center; gap:10px; margin-bottom:16px;
  position:sticky; top:76px; z-index:12;
  background:color-mix(in srgb, var(--body) 92%, transparent);
  backdrop-filter:blur(8px);
  padding:8px 0;
}
.report-document {
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  box-shadow:var(--shadow-sm);
  overflow:hidden;
}
.report-document__header {
  display:flex; align-items:flex-start; justify-content:space-between; gap:28px;
  padding:28px 30px 24px;
  border-bottom:1px solid var(--border);
  background:linear-gradient(135deg,#ffffff 0%,#f8fafc 100%);
}
.report-brand { display:flex; align-items:center; gap:13px; min-width:245px; }
.report-brand__logo { width:52px; height:52px; object-fit:cover; border-radius:14px; box-shadow:0 6px 18px rgba(49,46,129,.14); }
.report-brand__name { font-weight:800; font-size:17px; color:#111827; }
.report-brand__tagline { margin-top:2px; font-size:11px; color:#64748b; }
.report-document__heading { text-align:right; max-width:650px; }
.report-document__heading h1 { margin:0; font-size:24px; color:#111827; }
.report-document__heading p { margin:7px 0 0; color:#64748b; font-size:13px; line-height:1.5; }
.report-meta-grid {
  display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1px;
  background:var(--border); border-bottom:1px solid var(--border);
}
.report-meta-grid > div { background:#f8fafc; padding:13px 18px; min-width:0; }
.report-meta-grid span { display:block; color:#64748b; font-size:10px; text-transform:uppercase; letter-spacing:.04em; font-weight:700; }
.report-meta-grid strong { display:block; margin-top:4px; font-size:12px; color:#0f172a; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.report-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; padding:20px 24px 4px; }
.report-summary-card { border:1px solid var(--border); border-radius:13px; padding:14px 16px; background:#fff; }
.report-summary-card span { display:block; color:#64748b; font-size:11px; }
.report-summary-card strong { display:block; margin-top:5px; font-size:21px; color:#312e81; }
.report-table-section { padding:22px 24px 26px; }
.report-table-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:12px; }
.report-table-heading h2 { margin:0; font-size:15px; }
.report-table-heading span { color:var(--muted); font-size:12px; }
.report-table-wrap { border:1px solid var(--border); border-radius:12px; }
.report-table { min-width:900px; }
.report-table th { white-space:nowrap; }
.report-table td { vertical-align:top; }
.report-status-pill { display:inline-flex; padding:4px 8px; border-radius:999px; background:#f1f5f9; font-weight:700; font-size:11px; }
.report-empty { min-height:180px; }
.report-document__footer {
  display:flex; justify-content:space-between; gap:20px;
  border-top:1px solid var(--border); padding:12px 24px;
  color:#94a3b8; font-size:10px;
}

/* Card de aniversariantes no painel */
.dashboard-birthday-card { margin-bottom:16px; }
.dashboard-birthday-body { padding-top:10px; padding-bottom:10px; }
.dashboard-birthday-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.dashboard-birthday-row {
  display:grid; grid-template-columns:48px minmax(0,1fr) 28px; align-items:center; gap:10px;
  border:1px solid var(--border); border-radius:12px; padding:10px 12px; background:#fff;
}
.dashboard-birthday-date {
  width:44px; min-height:48px; border-radius:10px; display:flex; flex-direction:column; align-items:center; justify-content:center;
  background:#eef2ff; color:#4338ca;
}
.dashboard-birthday-date strong { font-size:16px; line-height:1; }
.dashboard-birthday-date span { font-size:9px; text-transform:uppercase; margin-top:3px; font-weight:700; }
.dashboard-birthday-main { min-width:0; }
.dashboard-birthday-main strong { display:block; font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dashboard-birthday-main span { display:block; color:var(--muted); font-size:10px; margin-top:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dashboard-birthday-icon { color:#6366f1; display:grid; place-items:center; }
.dashboard-birthday-icon svg { width:18px; height:18px; }
.dashboard-birthday-more { text-align:right; color:var(--muted); font-size:11px; padding-top:9px; }

@media (max-width:1180px) {
  .report-catalog { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-general-filters { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-birthday-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:720px) {
  .report-catalog, .report-general-filters, .dashboard-birthday-list { grid-template-columns:1fr; }
  .report-option-card { min-height:0; }
  .report-actions { position:static; flex-wrap:wrap; }
  .report-actions .spacer { display:none; }
  .report-actions .btn { flex:1 1 160px; justify-content:center; }
  .report-document__header { padding:20px; flex-direction:column; gap:18px; }
  .report-document__heading { text-align:left; }
  .report-meta-grid, .report-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .report-summary-grid { padding:16px 16px 2px; }
  .report-table-section { padding:18px 16px; }
  .report-document__footer { flex-direction:column; gap:4px; padding:12px 16px; }
}
@media (max-width:480px) {
  .report-meta-grid, .report-summary-grid { grid-template-columns:1fr; }
  .report-brand__logo { width:46px; height:46px; }
  .report-document__heading h1 { font-size:20px; }
}

@media print {
  @page { size: landscape; margin: 10mm; }
  html, body { background:#fff !important; }
  .sidebar, .sidebar-backdrop, .topbar, .no-print, .flash-stack { display:none !important; }
  .app, .main { display:block !important; min-height:0 !important; }
  .main { margin:0 !important; width:100% !important; }
  .content { padding:0 !important; max-width:none !important; }
  .report-document { border:0 !important; box-shadow:none !important; border-radius:0 !important; overflow:visible !important; }
  .report-document__header { padding:0 0 12px !important; background:#fff !important; }
  .report-meta-grid { border:1px solid #dbe2ea; }
  .report-summary-grid { padding:12px 0 4px !important; }
  .report-summary-card { break-inside:avoid; }
  .report-table-section { padding:14px 0 0 !important; }
  .table-wrap.report-table-wrap { overflow:visible !important; border:0 !important; }
  .report-table { min-width:0 !important; width:100% !important; font-size:9px !important; }
  .report-table th, .report-table td { padding:5px 6px !important; border:1px solid #dbe2ea !important; }
  .report-table thead { display:table-header-group; }
  .report-table tr { break-inside:avoid; }
  .report-document__footer { padding:10px 0 0 !important; }
}

/* ==========================================================
   ESCALAS PRO v1.5.8 — Calendário nominal no dashboard
   ========================================================== */
.dashboard-calendar-card { margin-bottom: 16px; }
.dashboard-calendar-head { align-items: center; }
.dashboard-calendar-head__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}
.transport-calendar-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.transport-marker {
  display: inline-grid;
  place-items: center;
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 6px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #c2410c;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(124,45,18,.08);
}
.dashboard-calendar-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}
.dashboard-calendar-mobile-hint {
  display: none;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10.5px;
}
.schedule-calendar--workers { gap: 8px; }
.schedule-calendar--workers .schedule-calendar__weekday {
  padding: 6px 0;
  font-size: 11px;
}
.schedule-calendar--workers .schedule-calendar__blank { min-height: 184px; }
.schedule-calendar__day--workers {
  min-height: 184px;
  padding: 8px;
  justify-content: flex-start;
  gap: 7px;
  overflow: hidden;
}
.schedule-calendar__day-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.schedule-calendar__day--workers .schedule-calendar__count {
  min-width: 23px;
  height: 23px;
  flex: 0 0 auto;
}
.schedule-calendar__names {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.schedule-calendar__person {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 3px 5px;
  border-radius: 6px;
  background: #f8fafc;
  color: #334155;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}
.schedule-calendar__person > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.schedule-calendar__person.uses-transport {
  background: #fff7ed;
  color: #9a3412;
  box-shadow: inset 2px 0 0 #f97316;
}
.schedule-calendar__person .transport-marker {
  width: 15px;
  min-width: 15px;
  height: 15px;
  border-radius: 5px;
  font-size: 8px;
}
.schedule-calendar__more {
  display: block;
  padding: 2px 4px;
  color: var(--brand-700);
  font-size: 9px;
  font-weight: 800;
  text-align: left;
}
.schedule-calendar__no-workers {
  margin-top: auto;
  color: var(--muted-2);
  font-size: 9px;
  font-weight: 600;
}
.dashboard-coverage-card { margin-bottom: 16px; }
.calendar-worker-name-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.calendar-worker-name-line strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-worker-detail {
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.35;
}
.calendar-worker-main small { margin-top: 3px; }

/* Cinco filtros do dashboard: unidade, setor, turno, mês e ano. */
@media (min-width: 769px) {
  .dashboard-filters {
    display: grid;
    grid-template-columns: minmax(0,1.4fr) minmax(0,1.4fr) minmax(0,1.2fr) minmax(0,.85fr) minmax(0,.75fr);
    gap: 10px;
    width: min(930px, 100%);
  }
  .dashboard-filters .field { min-width: 0; width: 100%; }
}

/* Tablet: mantém os nomes legíveis e o scroll restrito ao próprio card. */
@media (max-width: 900px) {
  .dashboard-calendar-mobile-hint { display: block; }
  .schedule-calendar--workers { min-width: 820px; }
  .schedule-calendar--workers .schedule-calendar__blank,
  .schedule-calendar--workers .schedule-calendar__day--workers { min-height: 180px; }
  .dashboard-calendar-head__meta { width: 100%; justify-content: space-between; }
}

@media (max-width: 768px) {
  .dashboard-filters .field:first-child { grid-column: auto; }
  .dashboard-calendar-card .card__head { gap: 10px; }
  .dashboard-calendar-head__meta { align-items: flex-start; }
  .calendar-card__body { padding: 10px; }
  .schedule-calendar--workers { gap: 6px; min-width: 800px; }
  .schedule-calendar--workers .schedule-calendar__weekday { font-size: 10px; }
  .schedule-calendar--workers .schedule-calendar__blank,
  .schedule-calendar--workers .schedule-calendar__day--workers { min-height: 176px; }
  .schedule-calendar__day--workers { padding: 7px; }
  .schedule-calendar__person { font-size: 9.5px; }
  .modal--wide { width: 100%; max-width: 100%; }
}

@media (max-width: 520px) {
  .dashboard-filters { grid-template-columns: 1fr 1fr !important; }
  .dashboard-filters .field { grid-column: auto !important; }
  .dashboard-calendar-head__meta { flex-direction: column; align-items: flex-start; gap: 7px; }
  .schedule-calendar--workers { min-width: 760px; }
  .calendar-worker-row { padding: 11px 0; }
}

@media (max-width: 390px) {
  .dashboard-filters { grid-template-columns: 1fr !important; }
}


/* ==========================================================
   ESCALAS PRO v1.5.15 — filtros dependentes e calendário de transporte
   ========================================================== */
.dashboard-calendar-print { flex: 0 0 auto; }
.dashboard-calendar-print svg { width: 15px; height: 15px; }
@media (max-width: 640px) {
  .dashboard-calendar-head__meta {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    justify-items: stretch;
  }
  .dashboard-calendar-head__meta > .badge,
  .dashboard-calendar-head__meta > .transport-calendar-legend {
    width: 100%;
    justify-content: center;
    white-space: normal;
    text-align: center;
  }
  .dashboard-calendar-print { width: 100%; }
}

/* ESCALAS PRO v1.5.19 — calendário do dashboard exibe até 7 colaboradores por data. */
