/* ==========================================================================
   Mondo Escala — design system
   Identidade: navy #232E45, verde #85C69C, creme #F7F6F1 e serifa editorial.
   ========================================================================== */

:root {
  --navy: #232e45;
  --navy-700: #2b364c;
  --navy-600: #35425c;
  --navy-500: #4a5873;
  --green: #85c69c;
  --green-600: #5ea87b;
  --green-700: #3f7c58;
  --green-050: #edf6f0;
  --cream: #f7f6f1;
  --paper: #ffffff;
  --ink: #1b2434;
  --muted: #687385;
  --muted-2: #8a94a3;
  --line: #e4e7ea;
  --line-strong: #d3d9df;
  --amber: #b9781f;
  --amber-050: #fdf5e7;
  --red: #b4483f;
  --red-050: #fbeeed;
  --blue: #3c6e9f;
  --blue-050: #eef4fa;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-xs: 0 1px 2px rgba(27, 36, 52, 0.05);
  --shadow-sm: 0 1px 2px rgba(27, 36, 52, 0.05), 0 2px 6px rgba(27, 36, 52, 0.04);
  --shadow-md: 0 8px 24px rgba(27, 36, 52, 0.08), 0 2px 6px rgba(27, 36, 52, 0.04);
  --shadow-lg: 0 24px 64px rgba(16, 24, 40, 0.18);
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --sidebar-w: 252px;
  --topbar-h: 70px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 110% -10%, rgba(133, 198, 156, 0.09), transparent 60%),
    var(--cream);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, figure {
  margin: 0;
}

a {
  color: var(--green-700);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

::selection {
  background: rgba(133, 198, 156, 0.35);
}

:focus-visible {
  outline: 3px solid rgba(94, 168, 123, 0.45);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-family: "Cascadia Mono", "Consolas", monospace; font-size: 12px; }
.text-ok { color: var(--green-700); }
.text-warn { color: var(--amber); }
.text-danger { color: var(--red); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.divider { height: 1px; background: var(--line); margin: 18px 0; border: 0; }

/* ------------------------------------------------------------------ */
/* Estrutura do aplicativo                                             */
/* ------------------------------------------------------------------ */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  z-index: 60;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 16px;
  color: #e7ece8;
  background:
    radial-gradient(420px 260px at 10% 0%, rgba(133, 198, 156, 0.16), transparent 65%),
    linear-gradient(180deg, #27334b 0%, #1b2436 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, transparent 0 47px, rgba(255, 255, 255, 0.025) 47px 48px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 72%);
}

.sidebar-brand {
  position: relative;
  z-index: 1;
  padding: 4px 10px 26px;
}

.sidebar-brand img {
  width: 152px;
  height: auto;
  margin-bottom: 12px;
}

.sidebar-brand span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(231, 236, 232, 0.55);
  font-weight: 600;
}

.sidebar-nav {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 5px 2px;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-label {
  padding: 0 12px 6px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(231, 236, 232, 0.42);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 9px;
  color: rgba(231, 236, 232, 0.74);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(133, 198, 156, 0.14);
  border-color: rgba(133, 198, 156, 0.22);
  color: #fff;
}

.nav-item.active .icon {
  color: var(--green);
}

.nav-item .icon {
  color: rgba(231, 236, 232, 0.55);
}

.nav-item .nav-count {
  margin-left: auto;
  background: var(--green);
  color: var(--navy);
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 7px;
}

.sidebar-foot {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
}

.user-card .user-meta {
  min-width: 0;
  flex: 1;
}

.user-card .user-name {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-card .user-role {
  color: rgba(231, 236, 232, 0.5);
  font-size: 11px;
}

.user-card .icon-btn {
  color: rgba(231, 236, 232, 0.55);
}

.user-card .icon-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.5);
  z-index: 55;
  backdrop-filter: blur(2px);
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 30px;
  background: rgba(247, 246, 241, 0.88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid rgba(228, 231, 234, 0.8);
}

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  min-width: 0;
}

.crumb strong {
  color: var(--ink);
  font-weight: 600;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.empresa-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.empresa-switch select {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  max-width: 220px;
  outline: none;
}

.empresa-atual {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.phase-pill .dot {
  background: var(--green-600);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 5px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  box-shadow: var(--shadow-xs);
}

.user-chip .user-chip-name {
  font-size: 12px;
  font-weight: 600;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 28px 32px 72px;
  animation: view-in 260ms var(--ease) both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mobile-only { display: none !important; }

/* ------------------------------------------------------------------ */
/* Cabeçalho de página                                                */
/* ------------------------------------------------------------------ */

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green-700);
  margin-bottom: 7px;
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--navy);
}

.page-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 720px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------ */
/* Botões                                                              */
/* ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 80ms var(--ease), box-shadow 140ms var(--ease);
  text-decoration: none;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 4px 12px rgba(35, 46, 69, 0.18);
}

.btn-primary:hover { background: #1b2436; }

.btn-accent {
  background: var(--green);
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(94, 168, 123, 0.2);
}

.btn-accent:hover { background: #78bd91; }

.btn-secondary {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--navy);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover { border-color: #b9c2cc; background: #fcfcfb; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover { background: rgba(27, 36, 52, 0.05); color: var(--ink); }

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover { background: #9c3b33; }

.btn-sm {
  min-height: 31px;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-block { width: 100%; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  transition: background 140ms var(--ease), color 140ms var(--ease);
}

.icon-btn:hover { background: rgba(27, 36, 52, 0.06); color: var(--ink); }

.icon-btn.danger:hover { background: var(--red-050); color: var(--red); }

/* ------------------------------------------------------------------ */
/* Cartões, grades e KPIs                                             */
/* ------------------------------------------------------------------ */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--navy);
}

.card-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.card-body { padding: 16px 20px 20px; }
.card-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: #fbfbf9;
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.grid { display: grid; gap: 18px; min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 17px 15px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--kpi-accent, var(--green));
  opacity: 0.8;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.kpi-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--kpi-soft, var(--green-050));
  color: var(--kpi-accent, var(--green-700));
}

.kpi-icon .icon { width: 16px; height: 16px; }

.kpi-value {
  font-family: var(--font-serif);
  font-size: 30px;
  line-height: 1;
  color: var(--navy);
  letter-spacing: -0.03em;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.kpi-value .unit {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0;
}

.kpi-foot {
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* ------------------------------------------------------------------ */
/* Badges, chips e progresso                                          */
/* ------------------------------------------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-ok { background: var(--green-050); color: var(--green-700); border-color: #d7eadf; }
.badge-warn { background: var(--amber-050); color: var(--amber); border-color: #f2e2c5; }
.badge-danger { background: var(--red-050); color: var(--red); border-color: #f1d6d3; }
.badge-info { background: var(--blue-050); color: var(--blue); border-color: #d8e5f1; }
.badge-neutral { background: #f2f3f5; color: var(--muted); border-color: #e5e8ec; }
.badge-navy { background: var(--navy); color: #fff; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: var(--muted-2);
}

.dot-ok { background: var(--green-600); }
.dot-warn { background: var(--amber); }
.dot-danger { background: var(--red); }
.dot-info { background: var(--blue); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 7px;
  background: #f3f4f6;
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--navy-600);
}

.progress {
  height: 6px;
  border-radius: 999px;
  background: #eef0f2;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--green-600);
  transition: width 500ms var(--ease);
}

.progress-bar.warn { background: var(--amber); }
.progress-bar.danger { background: var(--red); }

/* ------------------------------------------------------------------ */
/* Faixa legal / timeline                                             */
/* ------------------------------------------------------------------ */

.legal-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 20px 24px;
  border-radius: var(--radius);
  color: #eef2ee;
  background:
    radial-gradient(600px 200px at 90% 0%, rgba(133, 198, 156, 0.22), transparent 60%),
    linear-gradient(120deg, #232e45 0%, #2b364c 100%);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.legal-banner::before {
  content: "";
  position: absolute;
  right: -40px;
  top: -70px;
  width: 240px;
  height: 240px;
  border: 1px solid rgba(133, 198, 156, 0.35);
  border-radius: 50%;
}

.legal-banner::after {
  content: "";
  position: absolute;
  right: 15px;
  top: -120px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.legal-copy {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
}

.legal-copy .eyebrow { color: var(--green); margin-bottom: 5px; }

.legal-copy h2 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.legal-copy p {
  margin-top: 6px;
  color: rgba(238, 242, 238, 0.68);
  font-size: 12.5px;
  max-width: 640px;
}

.legal-timeline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 6px;
  flex: 0 0 auto;
}

.legal-step {
  padding: 0 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  min-width: 104px;
}

.legal-step:last-child { border-right: 0; }

.legal-step .date {
  font-size: 10.5px;
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legal-step .date::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.legal-step .what {
  font-family: var(--font-serif);
  font-size: 19px;
  margin-top: 2px;
}

.legal-step .desc {
  font-size: 10px;
  color: rgba(238, 242, 238, 0.5);
  margin-top: 1px;
}

.timeline {
  position: relative;
  padding-left: 22px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  padding: 0 0 17px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--green-600);
}

.timeline-item.done::before { background: var(--green-600); }
.timeline-item.future::before { border-color: var(--line-strong); }

.timeline-date {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-top: 1px;
}

.timeline-desc {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

/* ------------------------------------------------------------------ */
/* Tabelas                                                            */
/* ------------------------------------------------------------------ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 0 0 var(--radius) var(--radius);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf9;
  white-space: nowrap;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #eef0f2;
  vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 120ms var(--ease); }
.data-table tbody tr:hover { background: #fbfcfa; }
.data-table tbody tr.clickable { cursor: pointer; }

.row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.row-title .row-name {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.row-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--avatar-bg, #e9eff7);
  color: var(--avatar-fg, var(--navy));
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
}

.avatar-sm { width: 28px; height: 28px; border-radius: 8px; font-size: 10px; }
.avatar-lg { width: 44px; height: 44px; border-radius: 12px; font-size: 14px; }

/* ------------------------------------------------------------------ */
/* Formulários                                                        */
/* ------------------------------------------------------------------ */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-grid .full { grid-column: 1 / -1; }
.form-grid .third { grid-column: span 1; }

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > label,
.field > .label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--navy-600);
  display: flex;
  align-items: center;
  gap: 5px;
}

.field > label .req { color: var(--red); }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field input[type="search"],
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
  appearance: none;
}

.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687385' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 0;
  border-color: var(--green-600);
  box-shadow: 0 0 0 3px rgba(133, 198, 156, 0.2);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  background: #f5f6f7;
  color: var(--muted);
  cursor: not-allowed;
}

.field .hint {
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.35;
}

.form-section {
  margin-bottom: 22px;
}

.form-section:last-child { margin-bottom: 0; }

.form-section-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-error {
  background: var(--red-050);
  border: 1px solid #f0d3d0;
  color: #8d352e;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.form-error .icon { margin-top: 1px; }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--navy-600);
  cursor: pointer;
  line-height: 1.4;
}

.checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--green-700);
  flex: 0 0 auto;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--navy-600);
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .track {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d8dde3;
  transition: background 160ms var(--ease);
  position: relative;
  flex: 0 0 auto;
}

.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 160ms var(--ease);
}

.switch input:checked + .track { background: var(--green-600); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(94, 168, 123, 0.4); outline-offset: 2px; }

.password-field {
  position: relative;
}

.password-field input { padding-right: 42px; }

.password-field .icon-btn {
  position: absolute;
  right: 3px;
  top: 2px;
  width: 32px;
  height: 32px;
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-group > input,
.input-group > select { flex: 1; }

.input-group .btn { flex: 0 0 auto; }

/* ------------------------------------------------------------------ */
/* Modal                                                              */
/* ------------------------------------------------------------------ */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(16, 24, 40, 0.52);
  backdrop-filter: blur(3px);
  animation: fade-in 160ms var(--ease);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 44px);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.6);
  animation: modal-in 220ms var(--ease);
  overflow: hidden;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-sm { width: min(440px, 100%); }
.modal-lg { width: min(780px, 100%); }
.modal-xl { width: min(1020px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-head-copy { flex: 1; min-width: 0; }

.modal-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: #fbfbf9;
}

.modal-foot .foot-left { margin-right: auto; }

/* ------------------------------------------------------------------ */
/* Toast                                                              */
/* ------------------------------------------------------------------ */

.toast-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  font-size: 12.5px;
  color: var(--navy);
  animation: toast-in 220ms var(--ease);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast .icon { margin-top: 1px; }
.toast-ok { border-left: 3px solid var(--green-600); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--blue); }
.toast-warn { border-left: 3px solid var(--amber); }
.toast .toast-close { margin-left: auto; }

/* ------------------------------------------------------------------ */
/* Login                                                              */
/* ------------------------------------------------------------------ */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
}

.login-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 46px 56px 38px;
  color: #eef2ee;
  background:
    radial-gradient(700px 400px at 90% 10%, rgba(133, 198, 156, 0.22), transparent 65%),
    radial-gradient(500px 400px at -10% 100%, rgba(133, 198, 156, 0.1), transparent 60%),
    linear-gradient(150deg, #27334b 0%, #1a2334 100%);
  overflow: hidden;
}

.login-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse at 60% 40%, #000 0%, transparent 78%);
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -180px;
  bottom: -180px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(133, 198, 156, 0.22);
  border-radius: 50%;
  box-shadow: 0 0 0 60px rgba(133, 198, 156, 0.04), 0 0 0 120px rgba(133, 198, 156, 0.025);
}

.login-brand > * { position: relative; z-index: 1; }

.login-brand-top img {
  width: 190px;
  height: auto;
}

.login-brand-copy {
  max-width: 560px;
  padding: 40px 0;
}

.login-brand-copy .eyebrow { color: var(--green); }

.login-brand-copy h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(38px, 4.1vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 6px 0 18px;
}

.login-brand-copy h1 em {
  font-style: italic;
  color: var(--green);
}

.login-brand-copy > p {
  color: rgba(238, 242, 238, 0.66);
  font-size: 14px;
  line-height: 1.6;
  max-width: 430px;
}

.login-timeline {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 38px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  max-width: 520px;
}

.login-step .date {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--green);
}

.login-step .title {
  font-family: var(--font-serif);
  font-size: 19px;
  margin: 3px 0 2px;
}

.login-step .desc {
  font-size: 10.5px;
  color: rgba(238, 242, 238, 0.48);
  line-height: 1.35;
}

.login-brand-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(238, 242, 238, 0.4);
}

.login-brand-foot::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--green);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 44px;
  background: var(--cream);
}

.login-form-wrap {
  width: min(390px, 100%);
}

.login-mobile-logo { display: none; }

.login-form-wrap h2 {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.login-form-wrap > p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 26px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-form .field input {
  min-height: 44px;
  background: #fff;
}

.login-form .btn {
  min-height: 44px;
  margin-top: 4px;
}

.login-help {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
  font-size: 12px;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--green-700);
  font-size: 12px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.form-success {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--green-050);
  border: 1px solid #cfe6d8;
  color: var(--green-700);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.login-legal {
  margin-top: 24px;
  font-size: 10.5px;
  color: var(--muted-2);
  line-height: 1.5;
  display: flex;
  gap: 7px;
  align-items: flex-start;
}

.demo-box {
  margin-top: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 12px 13px;
  background: rgba(255, 255, 255, 0.6);
}

.demo-box .demo-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.demo-user {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  text-align: left;
  color: var(--navy-600);
  font-size: 11.5px;
}

.demo-user:hover { background: #fff; }
.demo-user strong { font-size: 12px; color: var(--navy); display: block; }
.demo-user span { color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Escala — grade semanal                                             */
/* ------------------------------------------------------------------ */

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 18px;
  align-items: start;
}

.schedule-card { overflow: hidden; }

.schedule-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfbf9;
}

.schedule-toolbar .spacer { flex: 1; }

.schedule-scroll {
  overflow: auto;
  max-height: calc(100vh - 290px);
  min-height: 320px;
}

.schedule-grid {
  width: 100%;
  min-width: 800px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.schedule-grid th,
.schedule-grid td {
  border-bottom: 1px solid #eef0f2;
  border-right: 1px solid #f1f3f5;
  padding: 0;
}

.schedule-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #fbfbf9;
  padding: 10px 8px;
  text-align: center;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.schedule-grid thead th:first-child {
  left: 0;
  z-index: 4;
  text-align: left;
  padding-left: 16px;
  min-width: 212px;
}

.schedule-grid .day-head .dow {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}

.schedule-grid .day-head .num {
  display: block;
  font-family: var(--font-serif);
  font-size: 17px;
  color: var(--navy);
  line-height: 1.15;
}

.schedule-grid .day-head.weekend { background: #f6f5ef; }
.schedule-grid .day-head.today { background: var(--green-050); }
.schedule-grid .day-head.today .num { color: var(--green-700); }
.schedule-grid .day-head.holiday .num { color: var(--amber); }
.schedule-grid .day-head .holiday-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  vertical-align: middle;
  margin-left: 3px;
}

.schedule-grid tbody td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #fff;
  padding: 9px 12px 9px 16px;
  min-width: 212px;
  border-right: 1px solid var(--line);
}

.schedule-grid tbody tr:hover td { background: #fcfdfb; }
.schedule-grid tbody tr:hover td:first-child { background: #fcfdfb; }

.employee-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.employee-cell .emp-name {
  font-weight: 600;
  color: var(--navy);
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.employee-cell .emp-role {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shift-cell {
  padding: 4px !important;
  text-align: center;
  vertical-align: middle;
  min-width: 82px;
}

.shift-cell.weekend { background: rgba(247, 246, 241, 0.55); }
.shift-cell.today { background: rgba(237, 246, 240, 0.5); }

.shift-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  width: 100%;
  padding: 6px 7px;
  border: 0;
  border-left: 3px solid var(--chip, var(--navy));
  border-radius: 6px;
  background: color-mix(in srgb, var(--chip, var(--navy)) 11%, #fff);
  text-align: left;
  color: var(--navy);
  transition: transform 120ms var(--ease), box-shadow 120ms var(--ease);
}

button.shift-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(27, 36, 52, 0.12);
}

.shift-chip .shift-name {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}

.shift-chip .shift-time {
  font-size: 9.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rest-chip {
  display: inline-block;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 0;
  opacity: 0.65;
}

.shift-cell .add-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 120ms var(--ease), border-color 120ms var(--ease);
}

.shift-cell:hover .add-cell { opacity: 1; }
.shift-cell .add-cell:hover { border-color: var(--green-600); color: var(--green-700); }

.schedule-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--topbar-h) + 18px); }

.score-card { text-align: center; padding: 20px; }

.score-ring { position: relative; width: 132px; height: 132px; margin: 4px auto 10px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-family: var(--font-serif);
  font-size: 34px;
  color: var(--navy);
  line-height: 1;
}
.score-ring .score-value small {
  font-family: var(--font-sans);
  font-size: 9.5px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 4px;
}

.summary-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.summary-row strong {
  margin-left: auto;
  color: var(--navy);
  font-size: 12.5px;
}

.coverage-row {
  display: grid;
  grid-template-columns: 32px 1fr 34px;
  gap: 8px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.coverage-row .bar {
  height: 5px;
  border-radius: 999px;
  background: #eef0f2;
  overflow: hidden;
}

.coverage-row .bar > span {
  display: block;
  height: 100%;
  background: var(--green-600);
  border-radius: inherit;
}

.schedule-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
}

.schedule-legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.schedule-legend .swatch {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--c);
}

/* ------------------------------------------------------------------ */
/* Regras / conformidade                                              */
/* ------------------------------------------------------------------ */

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rule-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 16px 17px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.rule-card.critico { border-left: 3px solid var(--red); }
.rule-card.alerta { border-left: 3px solid var(--amber); }
.rule-card.ok { border-left: 3px solid var(--green-600); }
.rule-card.pendente { border-left: 3px solid var(--line-strong); }

.rule-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.rule-top .badge { margin-left: auto; }

.rule-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
}

.rule-base {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

.rule-desc {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

.rule-detail {
  font-size: 11px;
  color: var(--navy-600);
  background: #f8f9f7;
  border-radius: 7px;
  padding: 7px 9px;
  line-height: 1.4;
}

.severity {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.severity.critico { color: var(--red); }
.severity.alerta { color: var(--amber); }
.severity.info { color: var(--blue); }

.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #eef0f2;
}

.alert-item:last-child { border-bottom: 0; padding-bottom: 0; }
.alert-item .alert-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: var(--amber-050);
  color: var(--amber);
}
.alert-item.critico .alert-icon { background: var(--red-050); color: var(--red); }
.alert-item.info .alert-icon { background: var(--blue-050); color: var(--blue); }
.alert-item .alert-copy { min-width: 0; }
.alert-item .alert-title { font-size: 12px; font-weight: 600; color: var(--navy); }
.alert-item .alert-desc { font-size: 11px; color: var(--muted); margin-top: 1px; line-height: 1.4; }

/* ------------------------------------------------------------------ */
/* Abas, vazio, esqueleto                                             */
/* ------------------------------------------------------------------ */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
}

.tab {
  padding: 9px 13px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  margin-bottom: -1px;
  transition: color 120ms var(--ease), border-color 120ms var(--ease);
}

.tab:hover { color: var(--navy); }
.tab.active { color: var(--navy); border-bottom-color: var(--green-600); }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty .empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--green-050);
  color: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.empty h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 21px;
  color: var(--navy);
  margin-bottom: 5px;
}

.empty p { font-size: 12.5px; max-width: 360px; margin-bottom: 16px; }

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, #eef0f2 25%, #f6f7f8 37%, #eef0f2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ */
/* Importação                                                         */
/* ------------------------------------------------------------------ */

.dropzone {
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: #fcfcfa;
  padding: 28px 20px;
  text-align: center;
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}

.dropzone.dragover {
  border-color: var(--green-600);
  background: var(--green-050);
}

.dropzone .icon-lg { color: var(--green-700); margin: 0 auto 8px; }

.dropzone h4 {
  font-size: 13.5px;
  color: var(--navy);
  margin-bottom: 3px;
}

.dropzone p { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }

.import-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 11px 14px;
  background: #f8f9f7;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.import-summary strong { color: var(--navy); }

.import-table td { font-size: 11.5px; padding: 8px 10px; }
.import-table .linha-erro { background: #fdf7f6; }

.row-errors {
  color: var(--red);
  font-size: 10.5px;
  line-height: 1.35;
}

.row-warns {
  color: var(--amber);
  font-size: 10.5px;
  line-height: 1.35;
}

/* ------------------------------------------------------------------ */
/* Empresa / horários                                                 */
/* ------------------------------------------------------------------ */

.hours-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hours-row {
  display: grid;
  grid-template-columns: 120px 1fr 14px 1fr 90px;
  gap: 8px;
  align-items: center;
}

.hours-row .day {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy-600);
}

.hours-row .sep { text-align: center; color: var(--muted-2); font-size: 11px; }

.hours-row input[type="time"] {
  min-height: 34px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
}

.hours-row .closed {
  font-size: 11px;
  color: var(--muted-2);
}

/* ------------------------------------------------------------------ */
/* Página do colaborador                                              */
/* ------------------------------------------------------------------ */

.week-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
}

.week-day {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  padding: 12px 10px;
  min-height: 116px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.week-day.weekend { background: #faf9f4; }
.week-day.today { border-color: var(--green-600); box-shadow: 0 0 0 2px rgba(133, 198, 156, 0.15); }

.week-day .wd {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.week-day .wd-num {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--navy);
  line-height: 1;
}

.week-day .shift-chip { margin-top: 3px; }
.week-day .rest-chip { margin-top: auto; }

.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(120deg, #232e45, #2f3d57);
  border-radius: var(--radius);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.profile-hero .avatar { background: rgba(255, 255, 255, 0.12); color: #fff; }
.profile-hero h2 { font-family: var(--font-serif); font-weight: 400; font-size: 24px; }
.profile-hero p { color: rgba(255, 255, 255, 0.6); font-size: 12px; }

/* ------------------------------------------------------------------ */
/* Semana, gráficos e pequenos componentes                            */
/* ------------------------------------------------------------------ */

.week-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 3px 4px;
  box-shadow: var(--shadow-xs);
}

.week-nav-label {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  padding: 0 6px;
  min-width: 140px;
}

.week-nav-label span {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted-2);
}

.week-nav-label strong {
  font-size: 11.5px;
  color: var(--navy);
  white-space: nowrap;
}

.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-svg text {
  font-family: var(--font-sans);
  fill: var(--muted-2);
  font-size: 9.5px;
}

.chart-svg .grid-line { stroke: #eef0f2; stroke-width: 1; }
.chart-svg .bar-prev { fill: #e9ecef; }
.chart-svg .bar-aloc { fill: var(--green-600); }
.chart-svg .pct { font-weight: 700; font-size: 9.5px; }
.chart-svg .dia { font-weight: 700; fill: var(--navy-600); font-size: 10px; }
.chart-svg .data { fill: var(--muted-2); font-size: 9px; }

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 10.5px;
  color: var(--muted);
  flex-wrap: wrap;
}

.chart-legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .sw { width: 9px; height: 9px; border-radius: 3px; }

.stat-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stat-line .big {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--navy);
}

/* ------------------------------------------------------------------ */
/* Filtros, abas de escala e edição de célula                         */
/* ------------------------------------------------------------------ */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-xs);
}

.search-field {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
}

.search-field .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-2);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px 8px 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
}

.filter-bar select {
  min-height: 38px;
  padding: 7px 30px 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-size: 12.5px;
  color: var(--navy-600);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23687385' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.pagination span strong {
  color: var(--ink);
}

.schedule-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.schedule-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid transparent;
}

.schedule-tab:hover { background: #f4f6f4; text-decoration: none; color: var(--navy); }
.schedule-tab.active { background: var(--navy); color: #fff; }
.schedule-tab.active .dot { background: var(--green); }
.schedule-tab small { font-size: 9.5px; font-weight: 500; opacity: 0.65; }

.cell-options {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.cell-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
}

.cell-option:hover { border-color: var(--line-strong); background: #fbfcfa; }
.cell-option:has(input:checked) { border-color: var(--green-600); background: var(--green-050); }
.cell-option input { position: absolute; opacity: 0; pointer-events: none; }

.cell-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--c);
  flex: 0 0 auto;
}

.cell-option-copy { display: flex; flex-direction: column; line-height: 1.25; }
.cell-option-copy strong { font-size: 12.5px; color: var(--navy); }
.cell-option-copy small { font-size: 10.5px; color: var(--muted); }

.coverage-table th { font-size: 9.5px; text-align: center; padding: 8px 6px; }
.coverage-table th small { display: block; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted-2); font-size: 9px; }
.coverage-table td { text-align: center; padding: 6px; }
.coverage-table td:first-child { text-align: left; padding-left: 12px; }
.coverage-table input {
  width: 58px;
  min-height: 30px;
  padding: 4px;
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 12px;
}

.coverage-table input:focus {
  outline: 0;
  border-color: var(--green-600);
  box-shadow: 0 0 0 2px rgba(133, 198, 156, 0.2);
}

/* ------------------------------------------------------------------ */
/* Utilidades finais                                                  */
/* ------------------------------------------------------------------ */

.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

.scroll-x { overflow-x: auto; }

.kbd {
  font-family: var(--mono, monospace);
  font-size: 10px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0 4px;
  color: var(--muted);
  background: #fff;
}

/* ------------------------------------------------------------------ */
/* Responsivo                                                         */
/* ------------------------------------------------------------------ */

@media (max-width: 1220px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-layout { grid-template-columns: minmax(0, 1fr); }
  .schedule-side { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform 220ms var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim.open { display: block; }
  .main { margin-left: 0; }
  .mobile-only { display: inline-flex !important; }
  .topbar { padding: 0 18px; }
  .view { padding: 22px 18px 64px; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .col-span-2 { grid-column: auto; }
  .legal-banner { flex-direction: column; align-items: flex-start; }
  .legal-timeline { width: 100%; }
  .legal-step { flex: 1; min-width: 0; padding: 0 10px; }
  .week-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; padding: 28px 20px; }
  .login-mobile-logo { display: block; margin-bottom: 26px; }
  .login-mobile-logo img { width: 170px; }
  .login-timeline { display: none; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal-overlay { padding: 10px; align-items: flex-end; }
  .modal { max-height: calc(100vh - 20px); border-radius: 16px 16px 12px 12px; }
  .schedule-side { grid-template-columns: minmax(0, 1fr); }
  .hours-row { grid-template-columns: 90px 1fr 12px 1fr; }
  .hours-row .closed { display: none; }
}

@media (max-width: 640px) {
  .page-head { align-items: flex-start; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr; }
  .rule-grid { grid-template-columns: 1fr; }
  .week-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-actions .phase-pill { display: none; }
  .user-chip .user-chip-name { display: none; }
  .legal-timeline { flex-direction: column; gap: 10px; }
  .legal-step { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 9px; }
  .legal-step:last-child { border-bottom: 0; }
  .legal-banner::before, .legal-banner::after { display: none; }
  .view { padding: 18px 14px 60px; }
  .card-head, .card-body { padding-left: 15px; padding-right: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-actions, .schedule-side, .schedule-toolbar, .toast-root, .schedule-legend { display: none !important; }
  .main { margin-left: 0; }
  .view { padding: 0; max-width: none; }
  .schedule-scroll { max-height: none; overflow: visible; }
  .card { box-shadow: none; border-color: #ccc; }
  .schedule-grid { min-width: 0; font-size: 10px; }
  .schedule-grid thead th, .schedule-grid tbody td:first-child { position: static; }
}
