@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Brand / semantic palette — medical, calm, accessible (4.5:1+ contrast) */
  --navy: #16243f;
  --blue: #0a5cb8;
  --soft-blue: #e3edff;
  --action-blue: #2f6fd1;
  --green: #1aa64a;
  --green-strong: #0f8c3c;
  --red: #b3261e;
  --orange: #e2711d;
  --line: #dde3ec;
  --line-strong: #c7cfdc;
  --muted: #5b6577;
  --paper: #ffffff;
  --bg: #f4f6fb;
  --focus-ring: #0a5cb8;

  --shadow-sm: 0 2px 8px rgba(22, 36, 63, 0.08);
  --shadow: 0 10px 30px rgba(22, 36, 63, 0.12);
  --shadow-lg: 0 18px 44px rgba(22, 36, 63, 0.18);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);

  font-family: "Inter", "Figtree", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

@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;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--navy);
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
  font-family: inherit;
}

a,
button,
.record-row,
.product-row,
.drawer-option,
.drawer-section,
[data-action] {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 6px;
}

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

.app-shell {
  min-height: 100vh;
  max-width: 1080px;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.app-shell:has(.empresa-view.is-active) {
  max-width: 1480px;
}

.app-shell:has(.prestador-view.is-active) {
  max-width: 1480px;
}

.app-shell:has(.prestador-view.is-active) > .topbar,
.app-shell:has(.empresa-view.is-active) > .topbar {
  display: none;
}

/* ── Topbar ─────────────────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(14px, 3vw, 28px) clamp(18px, 4vw, 40px);
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.topbar-user-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.topbar-user-role {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.4vw, 22px);
  min-width: 0;
}

.brand-mark {
  width: clamp(46px, 8vw, 76px);
  height: clamp(46px, 8vw, 76px);
  flex: 0 0 auto;
  border: 2px solid #6fc6cf;
  border-radius: 50%;
  position: relative;
  opacity: 0.92;
}

.brand-mark.has-custom-logo::before,
.brand-mark.has-custom-logo::after,
.brand-mark.has-custom-logo span {
  display: none;
}

.brand-mark.has-custom-logo {
  border: none;
}

.brand-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border: 2px solid #7d65b7;
  border-radius: 50%;
  inset: 12px 6px;
  transform: rotate(25deg);
}

.brand-mark::after {
  border-color: #4bb6c7;
  transform: rotate(-25deg);
}

.brand-mark span {
  width: 20px;
  height: 60px;
  border-radius: 22px;
  border-color: #8667bd;
  inset: 7px auto auto 28px;
  transform: rotate(-8deg);
}

.brand strong {
  display: block;
  font-family: "Figtree", "Inter", sans-serif;
  font-size: clamp(22px, 4.4vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  color: var(--navy);
  letter-spacing: -0.02em;
}

.brand small {
  display: block;
  margin-top: 4px;
  font-size: clamp(12px, 1.9vw, 16px);
  font-weight: 500;
  color: var(--muted);
}

.icon-button {
  border: 0;
  background: transparent;
  width: 48px;
  height: 48px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  transition: background-color 200ms var(--ease);
}

.icon-button:hover,
.icon-button:focus-visible {
  background: var(--soft-blue);
}

.icon-button span {
  width: 24px;
  height: 3px;
  background: var(--blue);
  border-radius: 999px;
  transition: transform 200ms var(--ease), opacity 200ms var(--ease);
}

/* ── Views ──────────────────────────────────────────────────────── */

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 220ms var(--ease);
}

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

h1 {
  margin: 0;
  font-family: "Figtree", "Inter", sans-serif;
  font-size: clamp(24px, 4.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

#home-view {
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 36px) 28px;
}

#home-title {
  text-align: center;
  margin-bottom: clamp(28px, 5vw, 48px);
  color: var(--navy);
}

.month-panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: clamp(34px, 6vw, 48px) clamp(20px, 5vw, 40px) clamp(22px, 4vw, 30px);
}

.business-chip {
  position: absolute;
  top: -20px;
  left: 20px;
  min-width: 150px;
  height: 40px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1f8fe0, #58b9fb);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: var(--shadow-sm);
}

.month-nav {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.month-nav h2 {
  margin: 0;
  text-align: center;
  color: var(--blue);
  font-size: clamp(18px, 3.2vw, 24px);
  font-weight: 700;
}

.arrow-button {
  border: 0;
  background: var(--soft-blue);
  color: var(--blue);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 200ms var(--ease), transform 150ms var(--ease);
}

.arrow-button:hover {
  background: #cfe0ff;
}

.arrow-button:active {
  transform: scale(0.94);
}

.count-grid {
  display: flex;
  justify-content: center;
  gap: clamp(12px, 3vw, 24px);
  margin-top: 24px;
  flex-wrap: wrap;
}

.count-card {
  flex: 1 1 140px;
  max-width: 220px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
}

.count-card:hover {
  border-color: var(--blue);
}

.count-card.is-active-filter {
  border-color: var(--blue);
  background: var(--soft-blue);
  box-shadow: 0 0 0 2px var(--blue);
}

.count-card.is-active-filter span {
  color: var(--blue);
}

.count-card.is-active-filter strong {
  color: var(--blue);
}

.count-card span {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.count-card strong {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
}

.registered-panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  position: relative;
  padding: 0 16px 84px;
}

.registered-panel h2 {
  margin: 0;
  padding: 22px 0 16px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
}

.registered-panel-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.registered-panel-header h2 {
  padding: 22px 0 0;
  border-bottom: none;
}

.registered-search-row {
  display: flex;
  gap: 8px;
}

.registered-search {
  flex: 1;
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  box-sizing: border-box;
}

.sort-date-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  white-space: nowrap;
}

.sort-date-button:hover {
  background: var(--soft-blue);
}

.sort-date-arrow {
  font-size: 11px;
  color: var(--action-blue);
}

.registered-search:focus {
  outline: none;
  border-color: var(--action-blue);
}

.registered-list {
  max-height: 420px;
  overflow: auto;
  padding-top: 12px;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  font-size: 16px;
  padding: 64px 16px;
}

.record-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(80px, 120px) 1fr auto;
  align-items: center;
  gap: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin: 10px 0;
  padding: 12px 14px;
  text-align: left;
  color: var(--navy);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), transform 120ms var(--ease);
}

.record-photo-icon {
  align-self: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--soft-blue);
  font-size: 18px;
  cursor: pointer;
}

.record-photo-icon:hover {
  background: var(--line);
}

.record-row:hover,
.record-row:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.record-row strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.record-row time {
  font-size: 13px;
  color: var(--muted);
}

.record-row .sn {
  font-size: 14px;
  color: var(--navy);
  overflow-wrap: anywhere;
}

.record-row .type {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.record-row.is-review strong {
  color: var(--green-strong);
}

.record-row.is-implant strong,
.record-row.is-implant .sn {
  color: var(--blue);
}

/* Seleção de registros */
.record-row {
  grid-template-columns: 20px minmax(80px, 120px) 1fr auto;
  align-items: start;
  cursor: pointer;
}

.record-row input[type="checkbox"] {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--blue);
  cursor: pointer;
  flex-shrink: 0;
}

.record-row.is-selected {
  border-color: var(--blue);
  background: #f0f5ff;
}

/* Badge de status */
.status-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 4px;
}

.status-badge.is-pendente {
  background: #fdf2da;
  color: #8a6300;
}

.status-badge.is-aprovado {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-badge.is-enviado {
  background: #e3f5ea;
  color: #226b3f;
}

.status-badge.is-confirmado {
  background: #ede9fe;
  color: #5b21b6;
}

.status-badge.is-rejeitado {
  background: #fee2e2;
  color: #b91c1c;
}

.status-badge.is-registrado {
  background: #e0f2fe;
  color: #0369a1;
}

/* Barra flutuante de envio */
.send-bar {
  position: sticky;
  bottom: 80px;
  margin: 0 -20px;
  padding: 12px 20px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 5;
  animation: slide-up 180ms var(--ease);
}

@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.send-bar-count {
  font-size: 13px;
  font-weight: 600;
}

.send-bar-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.send-bar-btn:hover {
  background: var(--green-strong);
}

.filter-button {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: 52px;
  height: 52px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease), transform 150ms var(--ease);
}

.filter-button:hover {
  background: var(--soft-blue);
  border-color: var(--line-strong);
}

.filter-button:active {
  transform: scale(0.95);
}

.filter-button.is-active-filter {
  background: var(--blue);
  border-color: var(--blue);
}

.filter-button.is-active-filter .filter-icon {
  background: #fff;
}

.filter-icon {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--blue);
  clip-path: polygon(0 0, 100% 0, 62% 46%, 62% 100%, 38% 100%, 38% 46%);
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0 0;
}

.primary-action,
.submit-button,
.secondary-action {
  min-height: 56px;
  border: 0;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: filter 180ms var(--ease), transform 120ms var(--ease), box-shadow 180ms var(--ease);
}

.primary-action:hover,
.submit-button:hover,
.secondary-action:hover {
  filter: brightness(1.07);
  box-shadow: var(--shadow);
}

.primary-action:active,
.submit-button:active,
.secondary-action:active {
  transform: translateY(1px);
}

.primary-action:disabled,
.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
  transform: none;
}

.review-action {
  background: var(--action-blue);
}

.implant-action,
.submit-button,
.secondary-action {
  background: var(--green);
}

/* ── Page heading / form ────────────────────────────────────────── */

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(16px, 3vw, 26px) clamp(18px, 4vw, 36px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 4;
}

.page-heading h1 {
  color: var(--navy);
  font-weight: 700;
}

.back-top {
  width: 44px;
  height: 44px;
  font-size: 22px;
  flex: 0 0 auto;
}

.form-view form,
.summary-view {
  padding: clamp(18px, 4vw, 32px) clamp(18px, 5vw, 48px) 32px;
  max-width: 760px;
  margin: 0 auto;
}

.summary-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.delete-record-btn {
  flex: 1;
  padding: 12px 20px;
  border: 1.5px solid var(--red);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--red);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}

.delete-record-btn:hover {
  background: #fdecec;
}

label {
  display: block;
  margin-top: 18px;
}

/* Garante que o atributo `hidden` sempre oculte o elemento,
   mesmo quando o CSS define display: flex / grid / block. */
[hidden] {
  display: none !important;
}

label span {
  display: block;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--navy);
}

input,
textarea,
select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  min-height: 48px;
  padding: 10px 14px;
  color: var(--navy);
  background: #fff;
  font-size: 16px;
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease);
}

input:hover,
textarea:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(10, 92, 184, 0.14);
}

input::placeholder,
textarea::placeholder {
  color: #9aa3b2;
}

textarea {
  height: 110px;
  resize: vertical;
}

.select-like {
  padding-right: 16px;
}

/* Evita que <input type="date"> ultrapasse a largura do container no mobile (iOS Safari) */
input[type="date"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Oculta o indicador nativo de datalist em todos os browsers */
input[list]::-webkit-calendar-picker-indicator {
  display: none !important;
  opacity: 0;
}

/* ── Combobox (lista suspensa pesquisável) ──────────────────────────── */
.combobox {
  position: relative;
  display: flex;
  align-items: center;
}

.combobox-input {
  flex: 1;
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.combobox-input:focus {
  border-color: var(--action-blue);
}

.combobox-arrow {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  color: #888;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  line-height: 1;
  transition: transform 0.2s;
}

.combobox.is-open .combobox-arrow {
  transform: rotate(180deg);
}

.combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 4px 0;
  list-style: none;
}

.combobox-list[hidden] {
  display: none;
}

.combobox-list li {
  padding: 11px 14px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 6px;
  margin: 2px 4px;
  color: var(--navy);
  transition: background 0.1s;
}

.combobox-list li:hover,
.combobox-list li.is-focused {
  background: var(--soft-blue);
  color: var(--action-blue);
}

.combobox-list li.is-empty {
  color: #aaa;
  font-style: italic;
  cursor: default;
}

.combobox-list li.is-empty:hover {
  background: none;
  color: #aaa;
}

.form-grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.prestador-row {
  margin-left: 0;
}

.material-panel {
  position: relative;
  margin-top: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px 22px;
  min-height: 140px;
}

.material-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-right: 64px;
  color: var(--muted);
}

.material-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.material-heading strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--blue);
}

.product-columns {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr auto;
  gap: 10px;
  margin-top: 16px;
  padding: 0 10px 0 16px;
}

.product-columns span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-list {
  margin-top: 14px;
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr auto;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px 8px 16px;
  font-size: 14px;
  gap: 10px;
  background: var(--bg);
  transition: border-color 160ms var(--ease);
}

.product-row:hover {
  border-color: var(--line-strong);
}

.product-row strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.product-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.remove-product {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--orange);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: filter 160ms var(--ease), transform 120ms var(--ease);
}

.remove-product:hover {
  filter: brightness(1.08);
}

.remove-product:active {
  transform: scale(0.94);
}

.add-product {
  position: absolute;
  right: 22px;
  top: -24px;
  width: 52px;
  height: 52px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 30px;
  line-height: 0.9;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: filter 180ms var(--ease), transform 150ms var(--ease);
}

.add-product:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.add-product:active {
  transform: scale(0.95);
}

.bottom-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: end;
  margin-top: 26px;
}

.attachment-box {
  position: relative;
  min-height: 64px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px 10px 84px;
  color: var(--muted);
  margin: 0;
  background: var(--bg);
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.attachment-box:hover {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.attachment-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.attachment-box span:not(.attach-badge) {
  font-size: 13px;
  font-weight: 600;
}

.attachment-box strong {
  font-size: 18px;
  color: var(--navy);
}

.attach-badge {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #fff;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
}

.submit-button {
  min-height: 52px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Cadastros (catálogo) ───────────────────────────────────────── */

.catalog-view .page-heading + .catalog-body {
  padding-top: 0;
}

.catalog-body {
  padding: clamp(16px, 4vw, 28px) clamp(18px, 4vw, 36px) 100px;
  max-width: 760px;
  margin: 0 auto;
}

.catalog-subtitle {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
}

.catalog-toolbar {
  margin-bottom: 16px;
}

.catalog-search input {
  background-image: none;
}

.catalog-search input[type="search"] {
  padding-left: 42px;
  background-repeat: no-repeat;
  background-position: 14px center;
  background-size: 18px 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6577' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}

.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalog-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 16px;
  color: var(--navy);
  transition: border-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 120ms var(--ease);
}

.catalog-row:hover,
.catalog-row:focus-visible {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

/* Modo somente leitura (técnico) */
.catalog-row.is-readonly {
  cursor: default;
  pointer-events: none;
  background: #fafbfd;
  color: var(--muted);
}

.catalog-row.is-readonly strong {
  color: var(--navy);
}

.catalog-row-arrow {
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.catalog-row strong {
  font-size: 15px;
  font-weight: 600;
}

.catalog-cfn {
  flex: 0 0 auto;
  margin-top: 1px;
  min-width: 84px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-align: left;
}

.catalog-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.catalog-info small {
  color: var(--muted);
  font-size: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.add-catalog-item {
  position: fixed;
  right: max(16px, calc((100vw - 1080px) / 2 + 20px));
  bottom: 28px;
  width: 56px;
  height: 56px;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 30px;
  line-height: 0.9;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-lg);
  z-index: 3;
  transition: filter 180ms var(--ease), transform 150ms var(--ease);
}

.add-catalog-item:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.add-catalog-item:active {
  transform: scale(0.95);
}

.catalog-dialog .catalog-dialog-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  position: static;
  margin-top: 28px;
}

.catalog-dialog .ok-button,
.catalog-dialog .secondary-action {
  position: static;
  width: auto;
  min-width: 110px;
}

.secondary-action.ghost {
  background: transparent;
  color: var(--orange);
  border: 1.5px solid var(--orange);
  box-shadow: none;
  margin-top: 0;
}

.secondary-action.ghost:hover {
  background: rgba(226, 113, 29, 0.1);
  filter: none;
  box-shadow: none;
}

.catalog-multi-check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--surface);
}
.catalog-multi-check-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 0;
}
.catalog-multi-check-list input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--action-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.catalog-form-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #fdecec;
  color: #b3261e;
  font-size: 13px;
  font-weight: 600;
}

/* ── Drawer / scrim ─────────────────────────────────────────────── */

.drawer,
.scrim {
  position: fixed;
  inset: 0;
  display: none;
}

.scrim {
  background: rgba(16, 26, 48, 0.32);
  z-index: 10;
  animation: fade-in 200ms var(--ease);
}

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

.drawer {
  left: auto;
  width: min(380px, calc(100vw - 32px));
  margin: 16px 16px 16px auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  z-index: 11;
  padding: 84px 24px 28px;
  animation: drawer-in 220ms var(--ease);
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

body.menu-open .drawer,
body.menu-open .scrim {
  display: block;
}

.drawer-menu {
  position: absolute;
  right: 16px;
  top: 16px;
}

.drawer-options {
  display: grid;
  gap: 0;
  overflow: hidden;
  max-height: 600px;
  transition: max-height 220ms var(--ease), opacity 180ms var(--ease);
}

.drawer-options.is-collapsed {
  max-height: 0;
  opacity: 0;
}

.drawer-section,
.drawer-option {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  background: var(--soft-blue);
  margin-bottom: 8px;
  padding: 0 14px;
  text-align: left;
  transition: background-color 180ms var(--ease), transform 120ms var(--ease);
}

.drawer-section:hover,
.drawer-option:hover {
  background: #cfe0ff;
}

.drawer-section:active,
.drawer-option:active {
  transform: scale(0.99);
}

.drawer-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer-option {
  background: var(--bg);
  color: var(--navy);
  font-weight: 500;
}

.drawer-option:hover {
  background: var(--line);
}

.chevron {
  width: 9px;
  height: 9px;
  border: solid var(--blue);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
}

/* ── Product modal ──────────────────────────────────────────────── */

/* ── CFN combobox no modal de produto ── */
.cfn-combobox { position: relative; }
.cfn-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px rgba(0,0,0,.12);
  list-style: none;
  margin: 0; padding: 4px 0;
  z-index: 9999;
  max-height: 260px;
  overflow-y: auto;
}
.cfn-option {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 13px;
}
.cfn-option:hover, .cfn-option.is-active { background: var(--soft-blue); }
.cfn-opt-code { font-weight: 700; color: var(--navy); white-space: nowrap; min-width: 80px; }
.cfn-opt-name { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfn-opt-cat {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: #fff;
  background: var(--blue); border-radius: 999px;
  padding: 2px 7px; white-space: nowrap;
}

.product-dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px 76px;
  color: var(--navy);
  box-shadow: var(--shadow-lg);
}

.product-dialog::backdrop {
  background: rgba(16, 26, 48, 0.32);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.dialog-header h2 {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: var(--navy);
  flex: 1;
}

.dialog-close-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, color 150ms;
  margin-left: 8px;
}

.dialog-close-btn:hover {
  background: #f0f0f5;
  color: var(--navy);
}

.product-dialog h2 {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 24px;
  color: var(--navy);
}

.product-dialog label {
  margin-top: 14px;
}

.product-dialog label span {
  font-size: 14px;
  margin-bottom: 6px;
}

.validity-field {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.gtin-scan-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.gtin-scan-row .gtin-label {
  flex: 1;
  min-width: 0;
}

.scan-button {
  flex-shrink: 0;
  height: 44px;
  border: 1.5px solid var(--blue);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--blue);
  font-size: 15px;
  font-weight: 600;
  padding: 0 16px;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
  white-space: nowrap;
}

.scan-button:hover {
  background: var(--blue);
  color: #fff;
}

.field-hint {
  display: none;
  margin-top: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.field-hint.is-visible { display: block; }

.field-hint.is-success {
  background: #e6f4ea;
  color: #1a7f3c;
}

/* ── Scanner de código de barras ──────────────────────────────── */
.scanner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border: none;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
}

.scanner-overlay::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.scanner-overlay[hidden] {
  display: none;
}

.scanner-box {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.scanner-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}

.scanner-viewport {
  position: relative;
  background: #000;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

#scanner-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-reticle {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 70%;
  height: 35%;
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.scanner-reticle::before,
.scanner-reticle::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--blue);
  border-style: solid;
}

.scanner-reticle::before {
  top: -2px;
  left: -2px;
  border-width: 3px 0 0 3px;
}

.scanner-reticle::after {
  bottom: -2px;
  right: -2px;
  border-width: 0 3px 3px 0;
}

.scanner-status {
  text-align: center;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
  min-height: 38px;
}

.scanner-fallback {
  padding: 0 16px 16px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-dialog small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.product-dialog menu {
  margin: 0;
  padding: 0;
}

.ok-button {
  position: absolute;
  right: 24px;
  bottom: 22px;
  min-width: 110px;
  height: 48px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: filter 180ms var(--ease), transform 120ms var(--ease);
}

.ok-button:hover {
  filter: brightness(1.07);
}

.ok-button:active {
  transform: translateY(1px);
}

.cancel-button {
  position: absolute;
  right: 144px;
  bottom: 22px;
  min-width: 110px;
  height: 48px;
  border: 1px solid var(--border, #ccc);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text, #333);
  font-size: 16px;
  font-weight: 600;
  transition: filter 180ms var(--ease), transform 120ms var(--ease);
}

.cancel-button:hover {
  filter: brightness(0.97);
}

.cancel-button:active {
  transform: translateY(1px);
}

/* ── Summary ────────────────────────────────────────────────────── */

.summary-content {
  display: grid;
  gap: 16px;
  margin-top: 24px;
}

.summary-card,
.summary-products {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.summary-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 16px;
  font-size: 15px;
}

.summary-card dt {
  color: var(--muted);
  font-weight: 600;
}

.summary-card dd {
  margin: 0;
}

.summary-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 16px;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.summary-badge.implant {
  background: var(--green);
}

.summary-badge.review {
  background: var(--action-blue);
}

.summary-products h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

/* Evidência de uso: miniaturas e visualização ampliada */
.summary-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.summary-photo-thumb {
  border: 1px solid #c2d3f0;
  border-radius: 8px;
  padding: 0;
  width: 64px;
  height: 64px;
  overflow: hidden;
  cursor: zoom-in;
  background: var(--soft-blue);
}

.summary-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.summary-photo-wrap {
  position: relative;
  display: inline-flex;
}

.anexo-del-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1;
}
.anexo-del-btn:hover { background: #b91c1c; }

.anexo-pdf-thumb {
  width: 64px;
  height: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 22px;
  cursor: pointer;
}
.anexo-pdf-thumb span {
  font-size: 9px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-anexos-wrap { margin-bottom: 12px; }
.edit-anexos-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
}
.edit-anexos-list { margin-top: 0; }

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 32, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: zoom-out;
}

.photo-lightbox img {
  max-width: 92vw;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.photo-lightbox-close {
  position: absolute;
  top: 16px;
  right: 24px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
}

@media print {
  .summary-photos,
  .photo-lightbox {
    display: none !important;
  }
}

.secondary-action {
  width: 100%;
  min-height: 52px;
  margin-top: 22px;
  font-size: 16px;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (min-width: 640px) {
  .home-actions {
    gap: 20px;
  }

  .secondary-action {
    width: auto;
    min-width: 220px;
  }
}

@media (max-width: 560px) {
  .form-grid.two,
  .home-actions,
  .bottom-form-row {
    grid-template-columns: 1fr;
  }

  .summary-card {
    grid-template-columns: 1fr;
    gap: 4px 12px;
  }

  .summary-card dt {
    margin-top: 8px;
  }

  .month-nav {
    grid-template-columns: 40px 1fr 40px;
  }

  .record-row {
    grid-template-columns: 20px minmax(72px, 96px) 1fr auto;
  }

  .product-row {
    grid-template-columns: minmax(96px, 130px) 1fr auto;
  }

  .ok-button {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 420px) {
  .topbar {
    padding: 12px 14px;
  }

  .brand small {
    display: none;
  }
}

/* ── Login / sessão ─────────────────────────────────────────────── */

/* Quando a tela de login está ativa, o app vira uma página independente:
   sem topbar/menu — não deve parecer continuação da página de registros. */
.app-shell.is-login-screen .topbar {
  display: none;
}

.app-shell.is-login-screen {
  max-width: 100%;
  margin: 0;
  box-shadow: none;
  background: transparent;
}

.app-shell.is-login-screen main {
  min-height: 100vh;
  padding: 0;
}

/* ════════════════════════════════════════════════════════════════════
   LOGIN — two-column layout (desktop) / single column (mobile)
   ════════════════════════════════════════════════════════════════════ */

.login-view.is-active {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
  background: var(--bg);
}

/* ── Painel de marca (esquerdo, desktop only) ─────────────────────── */
.login-brand {
  display: none; /* oculto no mobile */
}

@media (min-width: 960px) {
  .login-brand {
    display: flex;
    flex: 0 0 42%;
    background: var(--navy);
    background-image: radial-gradient(ellipse at 20% 80%, rgba(10,92,184,0.45) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 10%, rgba(47,111,209,0.3) 0%, transparent 55%);
    padding: 48px 52px;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    position: relative;
    overflow: hidden;
  }

  .login-brand::after {
    content: "";
    position: absolute;
    bottom: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.06);
  }

  .login-brand::before {
    content: "";
    position: absolute;
    top: -60px;
    left: -60px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.06);
  }
}

.login-brand-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  position: relative;
  z-index: 1;
}

.login-brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.login-brand-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0 0;
}

.login-brand-mark {
  width: clamp(140px, 22vw, 220px);
  height: clamp(140px, 22vw, 220px);
  flex: 0 0 auto;
  border: 2px solid #6fc6cf;
  border-radius: 50%;
  position: relative;
  opacity: 0.92;
}

.login-brand-mark::before,
.login-brand-mark::after,
.login-brand-mark span {
  content: "";
  position: absolute;
  border: 2px solid #7d65b7;
  border-radius: 50%;
  inset: 12% 6%;
  transform: rotate(25deg);
}

.login-brand-mark::after {
  border-color: #4bb6c7;
  transform: rotate(-25deg);
}

.login-brand-mark span {
  width: 18%;
  height: 60%;
  border-radius: 22px;
  border-color: #8667bd;
  inset: 7% auto auto 28%;
  transform: rotate(-8deg);
}

.login-brand-mark.has-custom-logo::before,
.login-brand-mark.has-custom-logo::after,
.login-brand-mark.has-custom-logo span {
  display: none;
}

.login-brand-mark.has-custom-logo {
  border: none;
}

.login-brand-showcase-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: -0.01em;
}

.login-brand-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 0 32px;
}

.login-brand-content h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}

.login-brand-content p {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 320px;
}

.login-brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-brand-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: rgba(255,255,255,0.80);
  font-weight: 500;
}

.login-brand-features li svg {
  flex-shrink: 0;
  color: #5ec5e5;
}

.login-brand-footer {
  font-size: 12px;
  color: rgba(255,255,255,0.30);
  margin: 0;
}

/* ── Painel do formulário (direito / único no mobile) ─────────────── */
.login-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  min-height: 100vh;
}

.login-form-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.login-header {
  text-align: left;
}

.login-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.login-header p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
}

/* ── Cards de perfil ──────────────────────────────────────────────── */
.profile-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-card {
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 1px 3px rgba(22,36,63,0.05);
}

.profile-card:hover {
  border-color: #c2d3f0;
  box-shadow: 0 2px 8px rgba(22,36,63,0.09);
}

.profile-card.is-selected {
  border-color: var(--action-blue);
  background: #f0f5ff;
  box-shadow: 0 0 0 3px rgba(47,111,209,0.12), 0 2px 8px rgba(22,36,63,0.08);
}

.profile-card-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  width: 100%;
  border: none;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.profile-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--soft-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--blue);
  transition: background 180ms ease, color 180ms ease;
}

.profile-card.is-selected .profile-card-icon {
  background: var(--action-blue);
  color: #fff;
}

.profile-card-text {
  flex: 1;
}

.profile-card-text strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  letter-spacing: -0.01em;
}

.profile-card-text small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
  line-height: 1.4;
}

.profile-card-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: transparent;
  transition: all 180ms ease;
}

.profile-card.is-selected .profile-card-check {
  background: var(--action-blue);
  border-color: var(--action-blue);
  color: #fff;
}

/* Expansão interna do card */
.profile-card-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms ease;
  padding: 0 16px;
}

.profile-card-expand > label {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.profile-card-expand > label span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-card.is-selected .profile-card-expand {
  grid-template-rows: 1fr;
  padding-bottom: 14px;
}

/* ── Select nativo estilizado (listbox de perfil) ─────────────────── */
.login-select-wrap {
  position: relative;
}

.login-select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--muted);
  pointer-events: none;
}

.login-select {
  width: 100%;
  padding: 10px 36px 10px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: var(--navy);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.login-select:focus {
  border-color: var(--action-blue);
  box-shadow: 0 0 0 3px rgba(47,111,209,0.12);
}

.login-select option[value=""] {
  color: var(--muted);
}

/* ── Botão entrar ─────────────────────────────────────────────────── */
.login-submit-btn {
  width: 100%;
  margin-top: 48px;
  padding: 14px 24px;
  background: var(--action-blue);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 180ms ease, box-shadow 180ms ease, opacity 180ms ease, transform 100ms ease;
  box-shadow: 0 2px 8px rgba(47,111,209,0.25);
  letter-spacing: -0.01em;
}

.login-submit-btn:hover:not(:disabled) {
  background: var(--blue);
  box-shadow: 0 4px 14px rgba(47,111,209,0.35);
}

.login-submit-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.login-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── Legados / utilitários ────────────────────────────────────────── */
#login-submit-btn {
  /* override antigo — agora usa .login-submit-btn */
  margin: 24px 0 0;
  min-width: unset;
}

.login-senha-wrap {
  margin-top: 16px;
  animation: fadeIn 200ms ease;
}
.login-senha-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.login-senha-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--paper);
  color: var(--text);
  transition: border-color 150ms;
  box-sizing: border-box;
}
.login-senha-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10,92,184,.12);
}

.login-extra {
  display: none;
  flex-direction: column;
  gap: 6px;
}

.login-extra.is-visible {
  display: flex;
}

.login-extra span {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

/* ── Prestador view ── */

.prestador-view.is-active {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.prest-sidebar {
  flex: 0 0 220px;
  min-height: 100vh;
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 24px 0;
  position: sticky;
  top: 0;
}

.prest-sidebar-brand {
  padding: 0 20px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 16px;
}

.prest-sidebar-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 10px;
}

.prest-sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prest-sidebar-logo #prest-sidebar-logo-fallback {
  font-family: "Figtree", "Inter", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.7);
}

.prest-sidebar-brand strong {
  display: block;
  font-family: "Figtree", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-word;
}

.prest-logo-change-btn {
  margin-top: 8px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-sm);
  background: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms, color 150ms;
}

.prest-logo-change-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.prest-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
  flex: 1 1 auto;
}

.prest-nav-logout {
  margin: 0 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  padding-top: 14px;
  color: rgba(255, 255, 255, 0.6);
}

.prest-nav-logout:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.prest-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background-color 150ms, color 150ms;
}

.prest-nav-item svg {
  flex: 0 0 auto;
}

.nav-item-subbtn {
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px 7px 44px;
  color: rgba(255,255,255,.5);
  margin-top: -4px;
}
.nav-item-subbtn:hover {
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.85);
}

.prest-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.prest-nav-item.is-active {
  background: var(--blue);
  color: #fff;
}

.prest-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  padding: clamp(16px, 3vw, 32px) clamp(16px, 3vw, 40px) 48px;
  box-sizing: border-box;
}

.prest-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.prest-main-header h1 {
  font-size: 22px;
  margin: 0;
  color: var(--navy);
}

.prest-hist-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.prest-hist-card-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 12px;
}

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

.prest-empty-state svg {
  color: var(--line-strong);
  margin-bottom: 4px;
}

.prest-empty-state strong {
  font-size: 14px;
  color: var(--text);
}

.prest-empty-state span {
  font-size: 13px;
}

.prest-alert-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdf2da;
  color: #8a6300;
  border: 1px solid #f5deae;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 12px;
}

.prest-alert-banner strong { font-weight: 800; }

.prest-alert-banner span { flex: 1 1 auto; }

.prest-alert-banner button {
  flex: 0 0 auto;
  border: 1px solid #8a6300;
  border-radius: var(--radius-sm);
  background: none;
  color: #8a6300;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
}

.prest-record-row.is-alerta {
  background: #fffaf0;
  border-color: #f5deae;
}
.prest-record-row.is-reprovado {
  background: #fff1f2;
  border-color: #fecdd3;
}
.prest-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  padding: 12px 0 6px;
}
.prest-section-title.is-reprovado { color: #b91c1c; }
.prest-reprovado-motivo {
  color: #b91c1c;
  font-style: italic;
}

.prest-record-info strong svg {
  vertical-align: -1px;
  color: #8a6300;
  margin-left: 4px;
}

tr.is-alerta { background: #fffaf0; }

.status-badge svg {
  vertical-align: -1px;
  margin-right: 4px;
}

.prest-config-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.prest-config-row input[type="number"] {
  width: 56px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
}

.prest-panel { display: none; }
.prest-panel.is-active { display: block; }

.prest-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.prest-count-badge {
  font-size: 13px;
  font-weight: 700;
  color: #8a6300;
  background: #fdf2da;
  padding: 4px 10px;
  border-radius: 20px;
}

.prest-approve-btn {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 150ms;
}

.prest-approve-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.prest-record-row {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.prest-record-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--blue);
}

.prest-record-info strong {
  display: block;
  font-size: 14px;
  color: var(--navy);
}

.prest-record-info small {
  font-size: 12px;
  color: var(--muted);
}

.prest-record-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.prest-reject-btn {
  padding: 4px 10px;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
}

/* ── Pending approval cards (prestador) ─────────────────────────────── */
.pcard {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
.pcard.is-alerta { border-color: #fbbf24; }
.pcard.is-reprovado { border-color: #fca5a5; background: #fff5f5; }

.pcard-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.pcard.is-reprovado .pcard-top { border-bottom-color: #fca5a5; }

.pcard-cb {
  width: 18px; height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--blue);
}
.pcard-badges { display: flex; gap: 6px; flex-shrink: 0; }
.pcard-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
}
.pcard-actions { margin-left: auto; flex-shrink: 0; }

.pcard-body {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
}
.pcard-col {
  flex: 1 1 200px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}
.pcard-col:last-child { border-right: none; }
.pcard-col-devs { flex: 1 1 220px; }
.pcard-col-foto { flex: 0 0 auto; display: flex; align-items: center; padding: 12px 14px; }

.pcard-field {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.4;
}
.pcard-field:last-child { margin-bottom: 0; }
.pcard-lbl {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  padding-top: 1px;
  min-width: 72px;
}

.pcard-dev-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 12px;
}
.pcard-dev-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  min-width: 54px;
}
.pcard-dev-sn { color: var(--muted); }

.pcard-foto { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.pcard-foto img { width: 100%; height: 100%; object-fit: cover; }

.pcard-motivo-banner {
  background: #fef2f2;
  border-top: 1px solid #fca5a5;
  padding: 8px 14px;
  font-size: 12px;
  color: #b91c1c;
  font-weight: 500;
}

.prest-hist-filters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  align-items: end;
}

.prest-hist-filters .emp-filter-clear {
  height: 36px;
}

@media (max-width: 900px) {
  .prest-hist-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prest-hist-filters select,
  .prest-hist-filters input[type="date"] {
    min-width: 0;
    width: 100%;
  }
}

.prest-hist-filters label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.prest-hist-filters span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted);
}

.prest-hist-filters input[type="month"],
.prest-hist-filters input[type="date"],
.prest-hist-filters select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  font-size: 13px;
  min-width: 140px;
}

.prest-add-tec-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  margin-bottom: 12px;
  text-align: center;
}

.prest-tec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.prest-tec-row strong { font-size: 14px; display: block; }
.prest-tec-row small { font-size: 12px; color: var(--muted); }

.prest-tec-remove {
  padding: 4px 10px;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  background: #fff;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 760px) {
  .prestador-view.is-active,
  .empresa-view.is-active {
    flex-direction: column;
  }

  .prest-sidebar {
    flex: none;
    width: 100%;
    min-height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 16px;
  }

  .prest-sidebar-brand {
    padding: 0;
    border-bottom: none;
    margin-bottom: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .prest-sidebar-logo {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .prest-sidebar-brand strong {
    font-size: 14px;
  }

  .prest-logo-change-btn {
    display: none;
  }

  .prest-nav {
    flex-direction: row;
    padding: 0;
  }

  .prest-nav-item {
    padding: 8px 10px;
    font-size: 0;
    gap: 0;
  }

  .prest-nav-item svg {
    width: 20px;
    height: 20px;
  }

  .prest-nav-logout {
    margin: 0;
    border-top: none;
    padding: 8px 10px;
  }

  .prest-main-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .emp-topbar-actions {
    flex-wrap: wrap;
    width: 100%;
  }

  .emp-filters-bar {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .emp-filter-group {
    flex-direction: column !important;
  }

  .emp-filter-field {
    flex: 1 1 auto !important;
    width: 100%;
  }

  .emp-filter-field select,
  .emp-filter-field input[type="date"] {
    width: 100%;
  }
}

/* ── Empresa dashboard ── */

/* ════════════════════════════════════════════════════════════════════
   EMPRESA — Painel gerencial (desktop-first)
   ════════════════════════════════════════════════════════════════════ */

.empresa-view.is-active {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

.empresa-view.is-active .prest-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ── Topbar do painel ─────────────────────────────────────────────── */
.emp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.emp-topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy);
}

.emp-topbar-title svg {
  opacity: 0.5;
  flex-shrink: 0;
}

.emp-topbar-title h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.02em;
}

.emp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Botão Propostas ──────────────────────────────────────────────── */
.emp-proposals-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
  position: relative;
}

.emp-proposals-trigger:hover,
.emp-proposals-trigger.has-proposals {
  border-color: var(--orange);
  color: var(--orange);
}

.emp-proposals-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ── Modal de propostas ───────────────────────────────────────────── */
.proposal-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.proposal-row:last-child {
  border-bottom: none;
}

.proposal-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.proposal-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proposal-action {
  font-size: 12px;
  font-weight: 700;
  background: #fff7ed;
  color: var(--orange);
  border: 1px solid #fed7aa;
  border-radius: 5px;
  padding: 2px 8px;
}

.proposal-cat {
  font-size: 12px;
  font-weight: 600;
  color: var(--navy);
}

.proposal-by {
  font-size: 12px;
  color: var(--muted);
}

.proposal-date {
  font-size: 11px;
  color: var(--muted);
  margin-left: auto;
}

.proposal-fields {
  font-size: 13px;
  color: var(--navy);
  background: var(--bg);
  border-radius: 6px;
  padding: 7px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.proposal-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.proposal-approve {
  padding: 6px 14px;
  border: 1.5px solid #0f8040;
  border-radius: 6px;
  background: #f0faf4;
  color: #0f8040;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
  white-space: nowrap;
}

.proposal-approve:hover { background: #dcf5e7; }

.proposal-reject {
  padding: 6px 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
  white-space: nowrap;
}

.proposal-reject:hover {
  border-color: var(--red);
  color: var(--red);
}

.emp-values-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms, box-shadow 150ms;
}

.emp-values-trigger:hover {
  border-color: var(--action-blue);
  color: var(--action-blue);
  box-shadow: 0 2px 8px rgba(47,111,209,0.1);
}

.emp-export-group {
  position: relative;
}
.emp-export-chevron {
  transition: transform 200ms;
  flex-shrink: 0;
}
.emp-export-group.is-open .emp-export-chevron { transform: rotate(180deg); }
.emp-export-group.is-open .emp-export-btn { background: var(--blue); }

.emp-export-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13);
  z-index: 200;
  padding: 6px;
  animation: fadeSlideDown 150ms ease;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.emp-export-dropdown-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 6px 10px 4px;
}
.emp-export-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: none;
  border-radius: 7px;
  text-align: left;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  transition: background 120ms;
}
.emp-export-option:hover { background: var(--surface); }
.emp-export-option.is-selected { background: #eff6ff; color: var(--action-blue); font-weight: 600; }
.emp-export-option svg { flex-shrink: 0; opacity: 0; }
.emp-export-option.is-selected svg { opacity: 1; }

.emp-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 8px;
  background: var(--action-blue);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms, box-shadow 150ms;
  box-shadow: 0 2px 8px rgba(47,111,209,0.22);
}

.emp-export-btn:hover {
  background: var(--blue);
  box-shadow: 0 4px 14px rgba(47,111,209,0.3);
}

/* ── Filtros ──────────────────────────────────────────────────────── */
.emp-filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  box-shadow: 0 1px 4px rgba(22,36,63,0.04);
}

.emp-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}

.emp-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 140px;
}

.emp-filter-field span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.emp-filter-field select,
.emp-filter-field input[type="date"] {
  height: 38px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: var(--navy);
  outline: none;
  transition: border-color 150ms;
}

.emp-filter-field select:focus,
.emp-filter-field input[type="date"]:focus {
  border-color: var(--action-blue);
}

.emp-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 150ms, color 150ms;
  flex-shrink: 0;
  align-self: flex-end;
}

.emp-filter-clear:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ── Filter trigger button + popup ───────────────────────────────── */
.filter-trigger-bar {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.filter-trigger-group {
  position: relative;
}

.filter-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms, background 150ms;
}

.filter-trigger-btn:hover,
.filter-trigger-btn.is-active {
  border-color: var(--action-blue);
  background: #f0f5ff;
  color: var(--action-blue);
}

.filter-trigger-btn.has-filters {
  border-color: var(--action-blue);
  background: #f0f5ff;
  color: var(--action-blue);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--action-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.filter-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 200;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(22,36,63,0.14);
  min-width: 320px;
  max-width: 560px;
  animation: popupIn 140ms var(--ease);
}

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

.filter-popup-inner {
  padding: 18px 18px 14px;
}

.filter-popup-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.filter-clear-btn {
  height: 36px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 150ms, color 150ms;
}

.filter-clear-btn:hover {
  border-color: var(--red);
  color: var(--red);
}

.filter-apply-btn {
  height: 36px;
  padding: 0 20px;
  border: none;
  border-radius: 7px;
  background: var(--action-blue);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 150ms;
}

.filter-apply-btn:hover {
  opacity: 0.88;
}

/* ── Stats cards ──────────────────────────────────────────────────── */
.emp-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.emp-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 150ms, border-color 150ms;
}

.emp-tab:hover {
  color: var(--navy);
}

.emp-tab.is-active {
  color: var(--action-blue);
  border-bottom-color: var(--action-blue);
}

.emp-tab-panel {
  display: none;
  flex-direction: column;
  gap: 20px;
}

.emp-tab-panel.is-active {
  display: flex;
}

.ind-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
}

.ind-section h3 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.ind-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 800px) {
  .ind-grid-2 {
    grid-template-columns: 1fr;
  }
}

.ind-chart {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 160px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
}

.ind-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 6px;
}

.ind-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 100%;
  width: 100%;
  justify-content: center;
}

.ind-bar {
  width: 12px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 200ms;
}

.ind-bar-revisao {
  background: #1d4ed8;
}

.ind-bar-implante {
  background: #16a34a;
}

.ind-chart-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}

.ind-legend {
  display: flex;
  gap: 18px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.ind-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ind-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.ind-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.ind-card {
  background: #f9fafb;
  border-radius: 10px;
  padding: 14px 16px;
}

.ind-card h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.ind-card-value {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  color: var(--navy);
  white-space: pre-wrap;
}

.emp-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.emp-stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 4px rgba(22,36,63,0.04);
  transition: box-shadow 150ms;
}

.emp-stat-card:hover {
  box-shadow: 0 4px 14px rgba(22,36,63,0.08);
}

.emp-stat-card .emp-stat-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.emp-stat-card .emp-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  letter-spacing: -0.02em;
}

.emp-stat-card.is-money .emp-stat-value {
  font-size: 22px;
  color: #0f8040;
}

/* ── Tabela de registros ──────────────────────────────────────────── */
.emp-records-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: visible;
  box-shadow: 0 1px 4px rgba(22,36,63,0.04);
}

.emp-records-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}

.emp-records-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.emp-records-title h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.01em;
}

.emp-records-count {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 10px;
  font-weight: 600;
}

.emp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.emp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

/* ── Status flow info popup ──────────────────────────────────────────── */
.status-flow-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 50%;
  transition: color 150ms, background 150ms;
  vertical-align: middle;
}
.status-flow-info-btn:hover { color: var(--action-blue); background: #eff6ff; }


.status-flow-popup {
  position: fixed;
  width: 280px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.16);
  z-index: 1000;
  padding: 16px 18px;
  animation: fadeSlideDown 150ms ease;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.sfp-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 12px;
}
.sfp-steps { display: flex; flex-direction: column; gap: 2px; }
.sfp-step { display: flex; align-items: center; gap: 10px; }
.sfp-arrow { font-size: 13px; color: var(--muted); padding-left: 6px; line-height: 1; }
.sfp-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  min-width: 90px;
  text-align: center;
}
.sfp-registrado{ background: #e0f2fe; color: #0369a1; }
.sfp-pendente  { background: #fef3c7; color: #92400e; }
.sfp-confirmado{ background: #ede9fe; color: #5b21b6; }
.sfp-aprovado  { background: #dbeafe; color: #1d4ed8; }
.sfp-enviado   { background: #dcfce7; color: #166534; }
.sfp-actor { font-size: 12px; color: var(--text); }
.sfp-footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.emp-table th {
  background: #fafbfd;
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.emp-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--navy);
}

.emp-table tr:last-child td {
  border-bottom: none;
}

.emp-table tbody tr {
  transition: background 120ms;
}

.emp-table tbody tr:hover td {
  background: #f4f7ff;
}

.emp-table .cell-muted {
  font-size: 12px;
  color: var(--muted);
  margin-top: 1px;
}

.emp-photo-icon {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: zoom-in;
  line-height: 1;
  padding: 4px;
  border-radius: 6px;
  transition: background 120ms;
}

.emp-photo-icon:hover {
  background: var(--soft-blue);
}

.emp-photo-none {
  color: var(--line-strong);
}

.emp-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--navy);
  white-space: nowrap;
  transition: border-color 150ms, color 150ms;
}

.emp-edit-btn:hover {
  border-color: var(--action-blue);
  color: var(--action-blue);
}

.emp-confirm-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid #0f8040;
  border-radius: 6px;
  background: #f0faf4;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #0f8040;
  white-space: nowrap;
  transition: background 150ms;
}

.emp-confirm-btn:hover {
  background: #dcf5e7;
}

.emp-confirm-btn.is-enviado {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #eff6ff;
}

.emp-confirm-btn.is-enviado:hover {
  background: #dbeafe;
}

.emp-reject-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1.5px solid #b91c1c;
  border-radius: 6px;
  background: #fff5f5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #b91c1c;
  white-space: nowrap;
  margin-left: 4px;
  transition: background 150ms;
}

.emp-reject-btn:hover {
  background: #fee2e2;
}

.emp-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: var(--navy);
  transition: border-color 150ms, color 150ms;
}

.emp-icon-btn:hover {
  border-color: var(--action-blue);
  color: var(--action-blue);
}

.emp-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1.5px solid #f3c2c2;
  border-radius: 6px;
  background: #fdf0f0;
  font-size: 14px;
  cursor: pointer;
  color: #c0392b;
  transition: background 150ms;
}

.emp-delete-btn:hover {
  background: #fbe0e0;
}

/* ── Modal: Tabela de valores ─────────────────────────────────────── */
/* ── Botão "Regras de alerta" ─────────────────────────────────────── */
.alerta-rules-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1.5px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 10px;
  transition: border-color 150ms, background 150ms;
}
.alerta-rules-btn:hover {
  border-color: var(--action-blue);
  background: #f0f5ff;
  color: var(--action-blue);
}

/* ── Modal de Regras de alerta ───────────────────────────────────── */
.rules-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(22,36,63,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rules-modal-overlay[hidden] { display: none; }

.rules-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(22,36,63,0.22);
  padding: 28px 28px 20px;
}

.rules-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.rules-modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.rules-modal-desc {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 20px;
  line-height: 1.5;
}

.rules-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.rules-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.rules-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rules-dot--red    { background: #e53e3e; }
.rules-dot--orange { background: #dd6b20; }
.rules-dot--blue   { background: var(--action-blue); }
.rules-dot--green  { background: #2f855a; }
.rules-dot--gray   { background: var(--muted); }

.rules-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}
.rules-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rules-field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--navy);
}
.rules-field > small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 4px;
}
.rules-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rules-input-row input[type="number"] {
  width: 72px;
  height: 36px;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  padding: 0 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--navy);
  text-align: center;
  outline: none;
  transition: border-color 150ms;
}
.rules-input-row input[type="number"]:focus {
  border-color: var(--action-blue);
}
.rules-unit {
  font-size: 12px;
  color: var(--muted);
}

.rules-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}

/* ── Toolbar da aba alertas ─────────────────────────────────────── */
#emp-alertas-toolbar {
  margin-bottom: 12px;
}

.emp-values-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.emp-values-modal[hidden] {
  display: none;
}

.emp-values-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.40);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.emp-values-modal-panel {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(16,24,40,0.18);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 32px 32px;
  animation: modal-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.emp-values-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.emp-values-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--navy);
}

.emp-values-modal-title-wrap svg {
  color: var(--action-blue);
  flex-shrink: 0;
}

.emp-values-modal-title-wrap h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  letter-spacing: -0.01em;
}

.emp-values-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms, color 150ms;
  flex-shrink: 0;
}

.emp-values-close:hover {
  background: #fee2e2;
  color: var(--red);
}

.emp-values-desc {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0 0 22px;
  line-height: 1.5;
}

.emp-values-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.emp-values-section {
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--line);
}
.emp-values-section:last-child { border-bottom: none; }

.emp-values-section-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}
.emp-values-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
}
.emp-values-section-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.emp-values-section-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.emp-value-row {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.emp-value-label {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.emp-value-input {
  width: 130px;
  flex-shrink: 0;
}

.emp-value-input {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line-strong);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  transition: border-color 150ms;
}

.emp-value-input:focus-within {
  border-color: var(--action-blue);
}

.emp-value-input span.currency {
  padding: 0 10px;
  font-size: 13px;
  color: var(--muted);
  background: var(--bg);
  align-self: stretch;
  display: flex;
  align-items: center;
  border-right: 1.5px solid var(--line);
  flex-shrink: 0;
}

.emp-value-input input {
  border: none;
  padding: 9px 10px;
  font-size: 14px;
  width: 100%;
  background: transparent;
  outline: none;
  font-family: inherit;
  color: var(--navy);
}

/* ── Drawer title ── */
.drawer-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--red);
  margin: 0 0 16px;
}

/* ── Session chip (card expansível) ── */
.session-chip {
  border-radius: var(--radius-sm);
  background: var(--soft-blue);
  margin-bottom: 12px;
  overflow: hidden;
}

.session-chip-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 10px;
}

.session-chip-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.session-chip strong {
  font-size: 13px;
  color: var(--navy);
}

.session-chip small {
  font-size: 11px;
  color: var(--muted);
}

/* Círculo vermelho com seta */
.session-chevron {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 200ms;
}

.session-chevron::after {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  border: solid var(--red);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 200ms;
}

.session-chip-toggle[aria-expanded="true"] .session-chevron::after {
  transform: rotate(-135deg) translateY(-2px);
}

/* Detalhe expandido */
.session-chip-detail {
  padding: 0 14px 12px;
  border-top: 1px solid rgba(0,0,0,0.07);
}

.session-chip-detail p {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--navy);
}

.session-chip-detail p:first-child {
  font-weight: 600;
}

.logout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: #fff;
  color: #b3261e;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-top: auto;
}

.logout-button:hover {
  background: #fdecec;
}

/* ── Alertas em formulário ─────────────────────────────────────── */

/* Campos que devem exibir e salvar em maiúsculas */
#paciente,
#iniciais,
#revisaoSn,
#ambulatorio-sn-input,
#catalog-cfn,
#modal-cfn {
  text-transform: uppercase;
}

.sn-device-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
  min-height: 18px;
}

.field-alert {
  display: none;
  margin-top: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: #fff4e5;
  color: #9a5b00;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.field-alert.is-visible {
  display: block;
}

.field-alert.is-error {
  background: #fdecec;
  color: #b3261e;
}

/* ── Materiais com validade vencida ───────────────────────────── */

.product-row.is-expired {
  border-color: #f3c4a0;
  background: #fff4e5;
}

.expired-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #b3261e;
  background: #fdecec;
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
}

/* ── Modo ambulatório (lote de SNs) ──────────────────────────────── */

.ambulatorio-batch {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin: 4px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


.ambulatorio-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.ambulatorio-entry-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ambulatorio-sn-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.ambulatorio-entry-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--soft-blue);
  border: 1px solid #c2d3f0;
  border-radius: 8px;
  padding: 10px 12px;
}

.ambulatorio-entry-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ambulatorio-entry-sn {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.02em;
}

.ambulatorio-entry-paciente {
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}

.ambulatorio-entry-date {
  font-size: 11px;
  color: var(--muted);
}

.ambulatorio-entry-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}

.ambulatorio-entry-remove:hover {
  color: var(--red);
}


/* ── Painel de Alertas ──────────────────────────────────────────── */
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c7302b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 5px;
  margin-left: 4px;
  line-height: 1;
}

.alertas-empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.alertas-section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 14px 0 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alertas-section-count {
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-size: 10px;
  padding: 1px 6px;
  font-weight: 600;
  letter-spacing: 0;
}

.alertas-empty-section {
  padding: 12px 4px 16px;
  color: var(--muted);
  font-size: 13px;
}

.alertas-summary {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}

.alertas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}

.alerta-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #e2711d;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.alerta-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alerta-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.alerta-tipo {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.alerta-detail {
  font-size: 12px;
  color: var(--muted);
}

/* ── Empresa: aba Cadastros ─────────────────────────────────────── */
.emp-cadastros-intro {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 0 20px;
}

.emp-cadastros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.emp-cadastro-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 18px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.emp-cadastro-card:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.emp-cadastro-icon {
  color: var(--blue);
  display: flex;
}

.emp-cadastro-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.emp-cadastro-count {
  font-size: 12px;
  color: var(--muted);
}

/* Aba Acompanhamento de Implantes */
.acomp-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.acomp-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.acomp-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}

.acomp-stat.is-ok    { border-color: #86efac; background: #f0fdf4; }
.acomp-stat.is-pend  { border-color: #fca5a5; background: #fff5f5; }
.acomp-stat.is-money { border-color: #6ee7b7; background: #ecfdf5; }
.acomp-stat-brl { font-size: 14px !important; }

.acomp-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}

.acomp-stat.is-ok  .acomp-stat-val { color: #166534; }
.acomp-stat.is-pend .acomp-stat-val { color: #b91c1c; }

.acomp-stat-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}

.acomp-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.acomp-select, .acomp-date {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-card);
  color: var(--text);
}

.acomp-clear-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-card);
  color: var(--muted);
  cursor: pointer;
}

.acomp-clear-btn:hover { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }

.acomp-table-wrap { overflow-x: auto; }

/* Tabela de acompanhamento */
.acomp-table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
.acomp-table thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2, #f5f7fa); text-align: left; padding: 9px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--border); white-space: nowrap; }
.acomp-table tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.acomp-table tfoot td { background: var(--surface-2, #f5f7fa); border-top: 2px solid var(--border); }
.acomp-table tbody tr:hover td { background: var(--surface, #f8fafc); }
.acomp-row { cursor: default; }
.acomp-date { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.acomp-proc { font-weight: 600; font-size: 13px; margin-top: 3px; white-space: normal; max-width: 160px; }
.acomp-prest { font-weight: 600; font-size: 13px; }
.acomp-td-val { font-weight: 800; color: #0f8040; white-space: nowrap; font-size: 13px; }
.acomp-td-obs { min-width: 180px; max-width: 240px; white-space: normal; }
.acomp-td-pac { max-width: 140px; white-space: normal; }
.acomp-td-hosp { max-width: 150px; white-space: normal; }
.acomp-cat-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .04em; vertical-align: middle; }
.acomp-cat-badge.is-impl { background: #dbeafe; color: #1d4ed8; }
.acomp-cat-badge.is-rev  { background: #fef9c3; color: #92400e; }
.acomp-obs-input { width: 100%; min-width: 160px; font-size: 12px; padding: 5px 8px; border: 1.5px solid var(--border); border-radius: 6px; background: var(--bg-card, #fff); color: var(--text); resize: none; overflow: hidden; line-height: 1.4; font-family: inherit; transition: border-color .15s; }
.acomp-obs-input:focus { outline: none; border-color: #2563eb; }
.acomp-obs-input::placeholder { color: var(--muted); }
.acomp-date-range { display: flex; align-items: center; gap: 4px; }
.acomp-empty { text-align: center; padding: 48px 16px; color: var(--muted); font-size: 14px; }
.cell-cfn { font-size: 12px; font-weight: 700; color: var(--text); }

/* ── Acompanhamento inline fields ─────────────────────────────────── */
.acomp-fat-select {
  width: 100%;
  min-width: 120px;
  padding: 4px 6px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  background: #f9fafb;
  color: var(--text);
  transition: border-color 150ms;
}
.acomp-fat-select:focus { outline: none; border-color: var(--blue); }
.acomp-fat-select.fat-pendente  { background: #f8f8f8; color: #666; }
.acomp-fat-select.fat-analise   { background: #fffbeb; color: #92400e; border-color: #fcd34d; }
.acomp-fat-select.fat-nota      { background: #eff6ff; color: #1d4ed8; border-color: #93c5fd; }
.acomp-fat-select.fat-enviado   { background: #f0f9ff; color: #0369a1; border-color: #7dd3fc; }
.acomp-fat-select.fat-cobranca  { background: #fef3c7; color: #78350f; border-color: #fbbf24; }
.acomp-fat-select.fat-pago      { background: #f0fdf4; color: #166534; border-color: #86efac; }
.acomp-fat-select.fat-glosado   { background: #fef2f2; color: #991b1b; border-color: #fca5a5; }
.acomp-fat-select.fat-recurso   { background: #faf5ff; color: #6d28d9; border-color: #c4b5fd; }

.acomp-inline-input {
  width: 100%;
  min-width: 90px;
  padding: 4px 6px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
  background: var(--paper);
  color: var(--text);
  transition: border-color 150ms;
}
.acomp-inline-input:focus { outline: none; border-color: var(--blue); }
.acomp-date-input { min-width: 110px; }
.acomp-val-input  { min-width: 90px; }

.acomp-td-fat-st  { min-width: 130px; }
.acomp-td-nota    { min-width: 110px; }
.acomp-td-date-fat, .acomp-td-date-pgto { min-width: 120px; }
.acomp-td-val-pago{ min-width: 95px; }

.acomp-stat.is-warn .acomp-stat-val  { color: #c2410c; }
.acomp-stat.is-money-pago .acomp-stat-val { color: #0f8040; }

.alerta-row.is-clickable {
  cursor: pointer;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alerta-row.is-clickable:hover {
  background: #f0f4ff;
  border-radius: 8px;
}

.alerta-arrow {
  margin-left: auto;
  font-size: 20px;
  color: var(--muted);
  padding-left: 8px;
  align-self: center;
}

.summary-reprovado-banner {
  background: #fff5f5;
  border: 1.5px solid #fca5a5;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #b91c1c;
}

.summary-reprovado-banner strong { display: block; margin-bottom: 4px; }
.summary-reprovado-banner p { margin: 4px 0; font-size: 13px; color: #7f1d1d; }
.summary-reprovado-banner small { font-size: 11px; color: #b91c1c; opacity: 0.7; }

.summary-actions-empresa {
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

.summary-reprovar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1.5px solid #b91c1c;
  border-radius: 8px;
  background: #fff5f5;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms;
}

.summary-reprovar-btn:hover { background: #fee2e2; }
.summary-reprovar-btn.small,
.emp-edit-btn.small {
  padding: 3px 8px;
  font-size: 12px;
}
.alert-group-actions { white-space: nowrap; display: flex; gap: 6px; align-items: center; }

.acomp-fat-date {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

/* Inline catalog within empresa */
.emp-inline-catalog-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.emp-inline-back {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--blue);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
  white-space: nowrap;
}

.emp-inline-back:hover { text-decoration: underline; }

.emp-inline-catalog-title {
  flex: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.emp-inline-catalog-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}

.emp-inline-count {
  font-size: 12px;
  color: var(--muted);
}

.emp-inline-add {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.emp-inline-add:hover { opacity: 0.88; }
.emp-readonly-badge { font-size: 12px; font-weight: 600; color: #92400e; background: #fef3c7; border: 1px solid #fcd34d; border-radius: 20px; padding: 4px 12px; }

.emp-inline-search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  margin-bottom: 8px;
  background: var(--bg-card);
  color: var(--text);
}

.emp-inline-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.emp-inline-list .catalog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}

.emp-inline-list .catalog-row:hover {
  border-color: var(--blue);
  background: #eff6ff;
}

.catalog-cfn {
  font-size: 11px;
  font-weight: 700;
  color: var(--blue);
  background: #eff6ff;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}

.catalog-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.catalog-info strong {
  font-size: 13px;
  color: var(--text);
}

.catalog-info small {
  font-size: 11px;
  color: var(--muted);
}

.catalog-row-arrow {
  color: var(--muted);
  font-size: 16px;
}

/* ── Modal detalhe catálogo (somente leitura) ── */
.catalog-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.catalog-detail-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  width: 100%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.catalog-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.catalog-detail-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}
.catalog-detail-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  line-height: 1;
}
.catalog-detail-close:hover { background: var(--soft-blue); color: var(--navy); }
.catalog-detail-body {
  padding: 8px 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.catalog-detail-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
}
.catalog-detail-row:last-child { border-bottom: none; }
.catalog-detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 130px;
  flex-shrink: 0;
}
.catalog-detail-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--navy);
  word-break: break-word;
}

.alerta-prestador {
  background: #eff6ff;
  color: #1d4ed8;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
}

/* ─── Admin Config Modal ─────────────────────────────────────────────────── */
.admin-config-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.admin-config-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-config-modal.acr-new { max-width: 620px; }

/* Header */
.acr-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line); gap: 16px;
}
.acr-header-text h2 { font-size: 17px; font-weight: 700; color: var(--navy); margin: 0 0 4px; }
.acr-header-text p  { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.5; }

/* Section */
.acr-section { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.acr-section:last-child { border-bottom: none; }
.acr-section-head {
  display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px;
}
.acr-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--navy); }
.acr-section-desc  { font-size: 12px; color: var(--muted); line-height: 1.45; }

/* Rule rows */
.acr-rules { display: flex; flex-direction: column; }
.acr-rule {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}
.acr-rule:last-child { border-bottom: none; padding-bottom: 0; }
.acr-rule:first-child { padding-top: 0; }

.acr-rule-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.acr-rule-name { font-size: 13px; font-weight: 600; color: var(--navy); }
.acr-rule-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }

.acr-rule-control {
  display: flex; flex-direction: column; align-items: center;
  gap: 3px; flex-shrink: 0; cursor: pointer;
}
.acr-num-input {
  width: 64px; padding: 6px 4px; border: 1.5px solid var(--line);
  border-radius: var(--radius); font-size: 18px; font-weight: 700;
  text-align: center; color: var(--navy); background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.acr-num-input:hover  { border-color: var(--accent); }
.acr-num-input:focus  { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.acr-num-unit { font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.admin-config-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.admin-config-header h2 { font-size: 16px; font-weight: 700; color: var(--navy); margin: 0; }
.admin-config-close {
  background: none; border: none; font-size: 18px; color: var(--muted);
  cursor: pointer; padding: 4px 6px; border-radius: 6px; line-height: 1;
}
.admin-config-close:hover { background: var(--soft-blue); color: var(--navy); }
.admin-config-body {
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
}
.admin-config-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.admin-config-section:last-child { border-bottom: none; }
.admin-config-section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--navy);
  margin: 0 0 12px;
}
.admin-config-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-config-field {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}
.admin-config-label {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}
.admin-config-input {
  width: 72px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: var(--navy);
  flex-shrink: 0;
}
.admin-config-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37,99,235,.15); }
.admin-config-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}
.admin-config-reset-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 8px 16px; border-radius: var(--radius); font-size: 13px; cursor: pointer;
}
.admin-config-reset-btn:hover { border-color: var(--accent); color: var(--accent); }
.admin-config-save-btn {
  background: var(--accent); color: #fff; border: none;
  padding: 8px 20px; border-radius: var(--radius); font-size: 13px; font-weight: 600; cursor: pointer;
}
.admin-config-save-btn:hover { background: var(--accent-dark, #1d4ed8); }
.admin-config-save-btn:disabled { opacity: .7; cursor: default; }

/* ─── Form Alert Bar (avisos não-bloqueantes) ────────────────────────────── */
.form-alert-bar {
  background: #fefce8;
  border: 1px solid #fbbf24;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.form-alert-item {
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

/* ─── Required mark ─────────────────────────────────────────────────────── */
.required-mark { color: #dc2626; font-size: 11px; }

/* ─── Regras de Alerta — Página visual ──────────────────────────────────── */
.regras-page { padding: 28px 32px; max-width: 960px; }
.regras-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.regras-page-header h2 { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.regras-page-header p { font-size: 13px; color: var(--muted); margin: 0; }
.regras-edit-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; background: var(--accent); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.regras-edit-btn:hover { background: var(--accent-dark, #1d4ed8); }

.regras-section { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.regras-section-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.regras-section-desc { font-size: 13px; color: var(--muted); margin-bottom: 24px; }

/* Timeline */
.regras-timeline-wrap { margin-bottom: 20px; }
.regras-timeline-legend { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.rtl-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.rtl-dot.rtl-green { background: #22c55e; }
.rtl-dot.rtl-orange { background: #f59e0b; }
.rtl-dot.rtl-red { background: #ef4444; }

.rtl-block { margin-bottom: 20px; }
.rtl-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.rtl-track { display: flex; align-items: stretch; min-height: 72px; gap: 0; border-radius: 10px; overflow: hidden; }

.rtl-point { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 10px; background: #f1f5f9; text-align: center; min-width: 56px; z-index: 1; }
.rtl-point-dot { width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; margin-bottom: 4px; border: 2px solid #fff; box-shadow: 0 0 0 2px #94a3b8; }
.rtl-point-dot.rtl-dot-blue { background: #3b82f6; box-shadow: 0 0 0 2px #3b82f6; }
.rtl-point-dot.rtl-dot-red { background: #ef4444; box-shadow: 0 0 0 2px #ef4444; }
.rtl-point-label { font-size: 10px; color: #64748b; line-height: 1.3; }

.rtl-zone { display: flex; align-items: center; justify-content: center; padding: 8px 12px; text-align: center; min-width: 48px; }
.rtl-zone-label { font-size: 11px; line-height: 1.4; color: #fff; }
.rtl-zone-label strong { display: block; font-size: 13px; font-weight: 700; }
.rtl-zone-ideal  { background: #22c55e; }
.rtl-zone-margin { background: #f59e0b; }
.rtl-zone-alert  { background: #ef4444; }

/* Chips de resumo */
.regras-chips-row { display: flex; flex-wrap: wrap; gap: 10px; }
.regras-chip { display: flex; align-items: center; gap: 10px; background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; flex: 1; min-width: 160px; }
.regras-chip-icon { font-size: 18px; }
.regras-chip-label { font-size: 11px; color: var(--muted); font-weight: 500; }
.regras-chip-value { font-size: 13px; color: var(--text); font-weight: 600; }

/* Cards de alertas */
.regras-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.regras-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.regras-card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.regras-card-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.regras-card-icon-red    { background: #fee2e2; color: #dc2626; }
.regras-card-icon-orange { background: #ffedd5; color: #ea580c; }
.regras-card-icon-purple { background: #f3e8ff; color: #9333ea; }
.regras-card-icon-blue   { background: #dbeafe; color: #2563eb; }
.regras-card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.regras-card-body { padding: 4px 0; }
.regras-card-row { padding: 12px 20px; border-bottom: 1px solid #f1f5f9; }
.regras-card-row:last-child { border-bottom: none; }
.regras-card-row-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 3px; }
.regras-card-row-desc { font-size: 13px; color: var(--text); line-height: 1.5; }
.regras-card-row-desc strong { color: var(--accent); }

.regras-card-red    .regras-card-head { background: #fff5f5; }
.regras-card-orange .regras-card-head { background: #fff8f1; }
.regras-card-purple .regras-card-head { background: #faf5ff; }
.regras-card-blue   .regras-card-head { background: #eff6ff; }

/* ─── Regras — Nova linha do tempo SVG ──────────────────────────────────── */
.regras-tl-block { margin-bottom: 24px; }
.regras-tl-svg-wrap { background: #f8fafc; border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; overflow-x: auto; margin-bottom: 12px; }
.regras-tl-example-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; margin-top: 4px; }

/* ─── Regras — Bloqueios ─────────────────────────────────────────────────── */
.regras-section-bloqueio { margin-top: 24px; }
.regras-section-bloqueio .regras-section-title { color: #dc2626; }
.regras-section-bloqueio .regras-section-title svg { stroke: #dc2626; }

.regras-bloqueio-list { display: flex; flex-direction: column; gap: 2px; }

.bloqueio-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-radius: 8px; transition: background .15s; }
.bloqueio-item:hover { background: #fef2f2; }
.bloqueio-icon { flex-shrink: 0; width: 28px; height: 28px; background: #fee2e2; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #dc2626; margin-top: 1px; }
.bloqueio-body { flex: 1; min-width: 0; }
.bloqueio-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.bloqueio-titulo { font-size: 13.5px; font-weight: 600; color: var(--text); }
.bloqueio-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }

.bloqueio-badge { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.badge-gray   { background: #f1f5f9; color: #475569; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-teal   { background: #ccfbf1; color: #0f766e; }

/* ─── Tabela de valores — breakdown CSP ─────────────────────────────────── */
.emp-value-label-wrap { display: flex; flex-direction: column; gap: 2px; }
.emp-value-row-csp { background: #f0fdf4; border-radius: 6px; }
.emp-value-csp-breakdown { font-size: 11px; color: #15803d; font-weight: 500; }

/* ─── Aba Aprovações ─────────────────────────────────────────────────────── */
.aprov-page { padding: 24px; display: flex; flex-direction: column; gap: 32px; }
.aprov-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.aprov-section-title { font-size: 16px; font-weight: 700; color: var(--text); }
.aprov-section-desc { font-size: 13px; color: var(--muted); }
.aprov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.aprov-empty { font-size: 14px; color: var(--muted); padding: 24px 0; }

.aprov-card { background: var(--card-bg, #fff); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.aprov-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 16px 16px 10px; }
.aprov-card-meta { display: flex; flex-direction: column; gap: 2px; }
.aprov-card-mes { font-size: 18px; font-weight: 700; color: var(--text); }
.aprov-card-prestador { font-size: 12px; color: var(--muted); font-weight: 500; }

.aprov-chip { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.aprov-chip.is-confirmado { background: #f3e8ff; color: #7c3aed; }
.aprov-chip.is-aprovado   { background: #dbeafe; color: #1d4ed8; }
.aprov-chip.is-enviado    { background: #dcfce7; color: #16a34a; }
.aprov-chip.is-rejeitado  { background: #fee2e2; color: #dc2626; }

.aprov-bar { height: 5px; display: flex; width: 100%; }
.aprov-bar-seg { height: 100%; transition: width .3s; }

.aprov-card-body { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.aprov-counts { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.aprov-sep { color: var(--border); }
.aprov-valor { font-size: 15px; font-weight: 700; color: #0f8040; white-space: nowrap; }

.aprov-card-foot { padding: 0 16px 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.aprov-action-btn { font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 8px; border: none; cursor: pointer; transition: opacity .15s; }
.aprov-action-btn.is-approve { background: #2563eb; color: #fff; }
.aprov-action-btn.is-send    { background: #16a34a; color: #fff; }
.aprov-action-btn:hover { opacity: .85; }
.aprov-note { font-size: 12px; color: var(--muted); }

/* ─── Subcategorias de geradores ─────────────────────────────────────────── */
.catalog-subtabs-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 16px 0; }
.catalog-subtab { font-size: 13px; font-weight: 600; padding: 6px 16px; border-radius: 20px; border: 2px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; transition: all .15s; white-space: nowrap; }
.catalog-subtab:hover { border-color: #2563eb; color: #2563eb; }
.catalog-subtab.is-active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ─── Regras CSP ─────────────────────────────────────────────────────────── */
.badge-yellow { background: #fef9c3; color: #b45309; }
.regras-csp-ref { margin: 16px 16px 4px; padding: 14px 16px; background: var(--surface, #f8fafc); border: 1px solid var(--border); border-radius: 10px; }
.regras-csp-ref-title { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 10px; }
.regras-csp-ref-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.regras-csp-tag { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.regras-csp-tag.acessorio { background: #dbeafe; color: #1d4ed8; }
.regras-csp-tag.eletrodo  { background: #dcfce7; color: #166534; }

/* ─── Dashboard do Responsável ───────────────────────────────────────────── */
.resp-dashboard { display: flex; flex-direction: column; gap: 36px; padding: 24px 20px; }
.resp-section-head { margin-bottom: 16px; }
.resp-section-title { font-size: 17px; font-weight: 700; color: var(--text); display: block; margin-bottom: 4px; }
.resp-section-note { font-size: 13px; color: var(--muted); }

/* Prestadores no escopo — um por linha */
.resp-prest-grid { display: flex; flex-direction: column; gap: 16px; }
.resp-prest-card { border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface, #fff); overflow: hidden; }
.resp-prest-card.is-pendente { border-color: #fbbf24; }
.resp-prest-card.is-ok       { border-color: #86efac; }

/* Cabeçalho do card */
.resp-prest-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.resp-prest-card.is-pendente .resp-prest-head { background: #fffbeb; }
.resp-prest-card.is-ok       .resp-prest-head { background: #f0fdf4; }
.resp-prest-nome  { font-size: 15px; font-weight: 800; color: var(--text); }
.resp-prest-badge { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 20px; background: #fef3c7; color: #b45309; white-space: nowrap; }
.resp-prest-badge.is-ok { background: #dcfce7; color: #166534; }

/* Stats em barra horizontal */
.resp-prest-stats { display: flex; border-bottom: 1px solid var(--border); }
.resp-prest-stat  { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 16px 8px; border-right: 1px solid var(--border); }
.resp-prest-stat:last-child { border-right: none; }
.resp-stat-val  { font-size: 22px; font-weight: 800; line-height: 1; margin-bottom: 5px; }
.resp-stat-lbl  { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.resp-stat-pendente { color: #d97706; }
.resp-stat-aprovado { color: #2563eb; }
.resp-stat-enviado  { color: #16a34a; }
.resp-stat-valor    { font-size: 16px; color: #0f8040; font-weight: 800; }

/* Pacotes para aprovação */
.resp-pacote { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.resp-pacote-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; background: var(--surface, #f8fafc); border-bottom: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.resp-pacote-mes { font-size: 15px; font-weight: 700; color: var(--text); margin-right: 10px; }
.resp-pacote-prest { font-size: 13px; color: var(--muted); font-weight: 600; }
.resp-pacote-head-right { display: flex; align-items: center; gap: 12px; }
.resp-pacote-total { font-size: 15px; font-weight: 700; color: #0f8040; }
.resp-pacote-table-wrap { overflow-x: auto; }
.resp-pacote-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.resp-pacote-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2, #f5f5f5); }
.resp-pacote-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.resp-rec-row { cursor: pointer; transition: background .1s; }
.resp-rec-row:hover { background: var(--surface, #f8fafc); }
.resp-rec-valor { font-weight: 700; color: #0f8040; white-space: nowrap; }
.aprov-action-btn.is-sm { font-size: 12px; padding: 5px 12px; }

/* ─── Técnicos no card do prestador (dashboard responsável) ──────────────── */
.resp-tec-section { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.resp-tec-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.resp-tec-total-sub { font-weight: 600; color: #166534; text-transform: none; letter-spacing: 0; }
.resp-tec-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.resp-tec-row:last-child { border-bottom: none; }
.resp-tec-nome { flex: 1; font-weight: 600; color: var(--text); }
.resp-tec-nivel { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #eff6ff; color: #1d4ed8; white-space: nowrap; }
.resp-tec-sub { font-size: 13px; font-weight: 700; color: #166534; white-space: nowrap; }
.resp-tec-empty { font-size: 12px; color: var(--muted); text-align: center; padding: 8px 0; margin: 0; }

/* ─── Gerenciar Senhas ───────────────────────────────────────────────────── */
.emp-senhas-wrap { margin-top: 24px; padding: 20px; background: var(--surface, #f8fafc); border: 1px solid var(--border); border-radius: 10px; }
.emp-senhas-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 16px; }
.emp-senhas-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.emp-senhas-table th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2, #f0f0f0); }
.emp-senhas-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.senha-edit-row { display: flex; gap: 8px; align-items: center; }
.senha-input { flex: 1; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg, #fff); color: var(--text); }
.senha-save-btn { padding: 6px 14px; background: #1d4ed8; color: #fff; border: none; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.senha-save-btn:hover { background: #1e40af; }

/* ─── Visão geral redesign (layout mockup) ───────────────────────────────── */
.vg-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.vg-left { display: flex; flex-direction: column; gap: 14px; }
.vg-prest-field { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vg-prest-icon { font-size: 16px; color: var(--muted); }
.vg-prest-lbl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vg-prest-sel { flex: 1; min-width: 120px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--bg,#fff); color: var(--text); }
.vg-total-box { background: #ede9fe; border-radius: 16px; padding: 18px; text-align: center; }
.vg-total-num { font-size: 56px; font-weight: 900; color: #6d28d9; line-height: 1; display: block; }
.vg-total-lbl { font-size: 12px; color: var(--muted); text-align: center; margin: 0; }
.vg-mes-nav { display: flex; align-items: center; justify-content: center; gap: 12px; }
.vg-mes-btn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg,#fff); font-size: 20px; cursor: pointer; color: var(--text); display: flex; align-items: center; justify-content: center; }
.vg-mes-btn:hover { background: var(--surface); }
.vg-mes-center { text-align: center; }
.vg-mes-nome { font-size: 20px; font-weight: 800; color: var(--text); display: block; }
.vg-mes-ano { font-size: 13px; color: var(--muted); display: block; }
.vg-gasto-card { background: var(--surface,#f8fafc); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.vg-gasto-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 10px; }
.vg-gasto-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text); padding: 4px 0; }
.vg-gasto-val { font-weight: 700; background: #fef9c3; color: #92400e; padding: 2px 8px; border-radius: 5px; font-size: 12px; white-space: nowrap; }
.vg-right { display: flex; flex-direction: column; gap: 16px; }
.vg-aprov-alertas-card { display: flex; background: var(--bg,#fff); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.vg-aprov-half, .vg-alerta-half { flex: 1; padding: 20px; }
.vg-half-title { font-size: 16px; font-weight: 700; margin: 0 0 14px; }
.vg-aprov-half .vg-half-title { color: #dc2626; }
.vg-alerta-half .vg-half-title { color: var(--text); }
.vg-divider-v { width: 1px; background: var(--border); flex-shrink: 0; }
.vg-half-tiles { display: flex; gap: 12px; }
.vg-aprov-tile { flex: 1; border-radius: 12px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.vg-aprov-tile.red { background: #fee2e2; }
.vg-aprov-tile.green { background: #dcfce7; }
.vg-tile-lbl { font-size: 13px; font-weight: 600; color: var(--text); }
.vg-aprov-tile.red .vg-tile-lbl { color: #b91c1c; }
.vg-aprov-tile.green .vg-tile-lbl { color: #15803d; }
.vg-tile-num { font-size: 36px; font-weight: 900; }
.vg-aprov-tile.red .vg-tile-num { color: #dc2626; }
.vg-aprov-tile.green .vg-tile-num { color: #16a34a; }
.vg-alerta-tile { flex: 1; background: var(--surface,#f8fafc); border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.vg-tile-lbl-dark { font-size: 13px; font-weight: 700; color: var(--text); }
.vg-tile-num-dark { font-size: 36px; font-weight: 900; color: var(--text); }
.vg-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.vg-col-card { background: var(--bg,#fff); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.vg-col-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 12px; text-align: center; }
.vg-imp-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text); padding: 3px 0; }
.vg-imp-sep { border-top: 1px solid var(--border); margin: 8px 0; }
.vg-proc-sublbl { font-size: 12px; color: var(--muted); text-align: center; margin: 8px 0 4px; font-weight: 600; }
.vg-proc-bubble { border-radius: 14px; padding: 14px; text-align: center; font-size: 36px; font-weight: 900; margin-bottom: 4px; }
.vg-proc-bubble.blue { background: #dbeafe; color: #1d4ed8; }
.vg-proc-bubble.green { background: #dcfce7; color: #16a34a; }
.vg-proc-bubble.blue-light { background: #ede9fe; color: #6d28d9; }
.vg-proc-bubble.purple-light { background: #f3f4f6; color: #374151; }
.ind-line-chart { width: 100%; max-width: 340px; height: 120px; display: block; }

/* ─── Aprovações redesign ────────────────────────────────────────────────── */
/* Aprovações left-nav prestador sub-items */
.aprov-nav-prest { display: block; width: 100%; text-align: left; padding: 8px 16px 8px 32px; font-size: 13px; font-weight: 500; color: var(--text-muted,#64748b); background: none; border: none; cursor: pointer; border-left: 3px solid transparent; transition: background .1s, color .1s; }
.aprov-nav-prest:hover { background: var(--surface-2,#f0f0f0); color: var(--text); }
.aprov-nav-prest.is-active-sub { color: #1d4ed8; font-weight: 700; border-left-color: #1d4ed8; background: #eff6ff; }

/* Aprovações new layout */
.aprov-new-layout { display: flex; flex-direction: column; gap: 20px; }
.aprov-main-card { display: grid; grid-template-columns: 1fr 220px; gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--bg,#fff); }
.aprov-main-left { padding: 20px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.aprov-main-right { padding: 20px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2,#f8fafc); }
.aprov-section-title { font-size: 13px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.aprov-section-badge { background: #fee2e2; color: #b91c1c; border-radius: 20px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.aprov-section-badge.is-green { background: #dcfce7; color: #15803d; }
.aprov-alert-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.aprov-alert-row:last-child { border-bottom: none; }
.aprov-alert-num { font-size: 28px; font-weight: 800; color: var(--text); min-width: 40px; text-align: center; background: var(--surface,#f1f5f9); border-radius: 8px; padding: 2px 8px; }
.aprov-alert-lbl { font-size: 12px; color: var(--muted); font-weight: 500; line-height: 1.4; }

/* Package cards inside left panel */
.aprov-pkg-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface,#f8fafc); }
.aprov-pkg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.aprov-pkg-meta { display: flex; flex-direction: column; gap: 1px; }
.aprov-pkg-mes { font-size: 14px; font-weight: 700; color: var(--text); }
.aprov-pkg-prest { font-size: 12px; color: var(--muted); }
.aprov-pkg-body { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.aprov-pkg-count { font-size: 12px; color: var(--muted); }
.aprov-pkg-valor { font-size: 14px; font-weight: 700; color: #0f8040; }
.aprov-pkg-foot { margin-top: 8px; }

/* Stats bar */
.aprov-stats-bar { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg,#fff); }
.aprov-stat-item { flex: 1; padding: 12px 16px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--border); }
.aprov-stat-item:last-child { border-right: none; }
.aprov-stat-val { font-size: 18px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aprov-stat-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

/* Records table section */
.aprov-table-section { display: flex; flex-direction: column; gap: 10px; }
.aprov-table-head { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.aprov-table-count { font-size: 12px; color: var(--muted); font-weight: 500; }
.aprov-rec-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.aprov-rec-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.aprov-rec-table th { padding: 7px 10px; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2,#f5f5f5); white-space: nowrap; }
.aprov-rec-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.aprov-rec-table tr:last-child td { border-bottom: none; }

/* ── Banco de Registros ──────────────────────────────────────────────────── */
.banco-view { display: flex; flex-direction: column; gap: 0; padding: 0; background: var(--bg,#f8fafc); min-height: 100vh; }
.banco-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 32px; background: var(--surface,#fff); border-bottom: 1px solid var(--border); }
.banco-header-left { display: flex; align-items: center; gap: 12px; }
.banco-header-left h1 { font-size: 20px; font-weight: 700; color: var(--text); margin: 0; }
.banco-header-left svg { color: #1a56db; }
.banco-header-right { display: flex; align-items: center; gap: 10px; }
.banco-btn-novo { display: flex; align-items: center; gap: 7px; background: #1a56db; color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-size: 14px; font-weight: 600; cursor: pointer; }
.banco-btn-novo:hover { background: #1447c0; }
.banco-btn-logout { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font-size: 13px; color: var(--text-muted,#64748b); cursor: pointer; }
.banco-btn-logout:hover { background: var(--surface-2,#f0f0f0); }
.banco-search-bar { display: flex; align-items: center; gap: 10px; padding: 16px 32px; background: var(--surface,#fff); border-bottom: 1px solid var(--border); }
.banco-search-bar svg { color: var(--muted,#94a3b8); flex-shrink: 0; }
.banco-search-input { flex: 1; border: none; background: none; font-size: 14px; color: var(--text); outline: none; }
#banco-content { padding: 24px 32px; }
.banco-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 60px 20px; color: var(--muted,#94a3b8); text-align: center; }
.banco-empty p { font-size: 15px; }
.banco-stats-bar { margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.banco-stats-bar strong { color: var(--text); }
.banco-table { width: 100%; border-collapse: collapse; background: var(--surface,#fff); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); font-size: 13px; }
.banco-table th { padding: 10px 14px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2,#f5f5f5); white-space: nowrap; }
.banco-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.banco-table tr:last-child td { border-bottom: none; }
.banco-td-nome { font-weight: 600; color: var(--text); }
.banco-td-device { max-width: 220px; }
.banco-device-tag { display: inline-block; background: #eff6ff; color: #1d4ed8; border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; margin: 2px 2px 2px 0; }
.banco-device-tag.eletrodo { background: #f0fdf4; color: #166534; }
.banco-td-acoes { white-space: nowrap; }
.banco-btn-edit, .banco-btn-del, .banco-btn-print { background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 6px; }
.banco-btn-edit:hover, .banco-btn-print:hover { background: var(--surface-2,#f0f0f0); }
.banco-btn-del:hover { background: #fee2e2; }

/* Modal */
.banco-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.banco-modal { background: var(--bg,#fff); border-radius: 14px; width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.banco-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px 16px; border-bottom: 1px solid var(--border); }
.banco-modal-header h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.banco-modal-close { background: none; border: none; cursor: pointer; color: var(--muted); padding: 4px; border-radius: 6px; }
.banco-modal-close:hover { background: var(--surface-2,#f0f0f0); }
.banco-modal-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.banco-modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }
.banco-form-row { display: flex; flex-direction: column; gap: 5px; }
.banco-form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.banco-label { font-size: 13px; font-weight: 600; color: var(--text); }
.banco-required { color: #dc2626; }
.banco-input { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 14px; color: var(--text); background: var(--bg,#fff); width: 100%; box-sizing: border-box; }
.banco-input:focus { outline: none; border-color: #1a56db; box-shadow: 0 0 0 2px rgba(26,86,219,.12); }
.banco-textarea { resize: vertical; min-height: 60px; }
.banco-form-divider { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 4px 0; border-bottom: 1px solid var(--border); }
.banco-device-results { border: 1px solid var(--border); border-radius: 8px; background: var(--bg,#fff); margin-top: 4px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.1); }
.banco-device-result-item { display: flex; align-items: center; justify-content: space-between; width: 100%; text-align: left; padding: 9px 14px; background: none; border: none; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.banco-device-result-item:last-child { border-bottom: none; }
.banco-device-result-item:hover { background: var(--surface-2,#f0f0f0); }
.banco-dr-nome { color: var(--text); font-weight: 500; }
.banco-dr-cfn { color: var(--muted); font-size: 11px; }
.banco-device-selected, .banco-eletrodos-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.banco-device-chip { display: flex; align-items: center; gap: 8px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 20px; padding: 4px 12px; font-size: 12px; }
.banco-chip-nome { font-weight: 600; color: #1d4ed8; }
.banco-chip-cfn { color: #6b7280; font-size: 11px; }
.banco-chip-remove { background: none; border: none; cursor: pointer; color: #6b7280; font-size: 16px; line-height: 1; padding: 0 2px; }
.banco-chip-remove:hover { color: #dc2626; }
.banco-btn-cancel { background: none; border: 1px solid var(--border); border-radius: 8px; padding: 9px 18px; font-size: 14px; cursor: pointer; color: var(--text); }
.banco-btn-save { display: flex; align-items: center; gap: 7px; background: #1a56db; color: #fff; border: none; border-radius: 8px; padding: 9px 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.banco-btn-save:hover { background: #1447c0; }

/* ─── Modal de seleção de fluxo (Medtronic x Prestadora) ─── */
.fluxo-select-overlay { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.fluxo-select-card { background: var(--bg,#fff); border-radius: 16px; width: 100%; max-width: 440px; padding: 28px 28px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.22); }
.fluxo-select-header { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.fluxo-select-header svg { color: #1a56db; flex-shrink: 0; }
.fluxo-select-sub { font-size: 13px; color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.fluxo-select-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.fluxo-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 2px solid var(--border); border-radius: 12px; padding: 20px 14px 16px; background: var(--bg,#fff); cursor: pointer; transition: border-color .15s, background .15s; text-align: center; }
.fluxo-btn:hover { border-color: #1a56db; background: #eff6ff; }
.fluxo-btn-logo { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.fluxo-btn-medtronic .fluxo-btn-logo { background: #1a56db; }
.fluxo-btn-prestadora .fluxo-btn-logo { background: #0891b2; }
.fluxo-btn-label { font-size: 14px; font-weight: 700; color: var(--text); }
.fluxo-btn-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.fluxo-select-cancel { display: block; width: 100%; background: none; border: none; color: var(--muted); font-size: 13px; padding: 6px; cursor: pointer; text-align: center; }
.fluxo-select-cancel:hover { color: var(--text); }
/* Badge de origem no cabeçalho do formulário */
.fluxo-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 3px 10px; letter-spacing: .03em; }
.fluxo-badge-medtronic { background: #dbeafe; color: #1d4ed8; }
.fluxo-badge-prestadora { background: #cffafe; color: #0e7490; }
