:root {
  --navy: #142a36;
  --blue: #237a8b;
  --cyan: #55b7b3;
  --teal: #2aa8a6;
  --bg: #f3f6f6;
  --ink: #18262d;
  --muted: #708088;
  --line: #dfe7e7;
  --white: #fff;
  --warn: #d8952e;
  --danger: #b94c55;
  --ok: #27866b;
  --sidebar: 242px;
  --font: Manrope, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 14px/1.45 var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
}
.muted { color: var(--muted); }
.eyebrow {
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  margin: 0;
  text-transform: uppercase;
}

/* Login gate */
.gate {
  position: fixed; inset: 0; z-index: 100;
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 0% 0%, #1a3a3a 0%, transparent 50%),
    radial-gradient(800px 400px at 100% 0%, #243047 0%, transparent 45%),
    #0e141b;
  color: #e8eef5;
}
/* display:grid above would otherwise override HTML [hidden] */
.gate[hidden],
#app[hidden] {
  display: none !important;
}
.gate-card {
  width: min(440px, 100%); background: #172029; border: 1px solid #2b3846;
  border-radius: 16px; padding: 1.6rem; box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.gate .eyebrow { color: var(--teal); }
.gate-card h1 { margin: 0.4rem 0; color: #fff; font-size: 1.8rem; }
.gate .muted { color: #95a6b8; }
.gate-actions { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.2rem; }
.gate-actions input {
  background: #121820; border: 1px solid #2b3846; border-radius: 8px;
  color: #e8eef5; padding: 0.65rem 0.75rem; font: inherit;
}
.google-btn { display: flex; justify-content: center; min-height: 44px; }
.msg { margin-top: 0.8rem; }
.msg.ok { color: #3cb371; }
.msg.err { color: #d45d5d; }
.gate .msg.ok { color: #9dffc0; }
.gate .msg.err { color: #ffb4b4; }

/* Shell */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--navy); color: #fff;
  padding: 22px 16px; display: flex; flex-direction: column; gap: 18px;
  z-index: 30;
}
.sidebar-user {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding-bottom: 16px; border-bottom: 1px solid #38505b;
}
.sidebar-user img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(42,168,166,.45); background: #1c3a48;
}
.sidebar-user-text b {
  display: block; color: #fff; font: 700 13px/1.25 var(--font);
}
.sidebar-user-text small {
  display: block; margin-top: 4px; color: #9eb3bc; font: 500 11px/1.3 var(--font);
}
.sidebar-email {
  display: block; margin-top: 6px; color: #9eb3bc;
  font: 500 10px/1.3 var(--font); word-break: break-all;
}
.sidebar-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; margin-top: 4px; }
.sidebar-actions button {
  border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff;
  border-radius: 8px; padding: 7px 10px; cursor: pointer; font: 700 12px var(--font);
}
.sidebar-actions button:hover { border-color: #2aa8a6; color: #9fe3e0; }

.sidebar-nav { display: grid; gap: 6px; }
.sidebar-nav .nav-btn {
  border: 0; background: transparent; color: #b8c7cd; text-align: left;
  padding: 12px 14px; border-radius: 9px; font: 600 13px var(--font); cursor: pointer;
}
.sidebar-nav .nav-btn.active,
.sidebar-nav .nav-btn:hover {
  background: #fff; color: var(--navy);
}

.sidebar-foot {
  margin-top: auto; border-top: 1px solid #38505b; padding: 18px 8px 0;
}
.sidebar-foot b {
  color: var(--cyan); font-size: 10px; letter-spacing: .12em;
}
.sidebar-foot p { color: #b8c7cd; font-size: 12px; margin: 8px 0 0; }

.content {
  margin-left: var(--sidebar);
  padding: 28px 36px 60px;
  max-width: 1600px;
}
.page-header {
  display: flex; justify-content: space-between; gap: 24px;
  align-items: flex-start; margin-bottom: 22px;
}
.page-header h1 {
  font-size: 30px; margin: 3px 0 4px; letter-spacing: -.04em; color: var(--ink);
}
.page-header p:last-child { color: var(--muted); margin: 3px 0; }
.brand-mark {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy);
}
.brand-mark span {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; background: linear-gradient(135deg, #2aa8a6, #146f7a);
  color: #fff; font-weight: 800;
}
.brand-mark strong { font-size: 18px; letter-spacing: .02em; }

.view { display: none; }
.view.active { display: block; }

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 21px;
  margin-bottom: 16px;
}
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-head p { margin: 3px 0 0; color: var(--muted); }
.panel-head.row {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start;
  margin-bottom: 12px;
}

.btn {
  border-radius: 8px; border: 1px solid var(--line); padding: 0.55rem 0.9rem;
  cursor: pointer; font: 700 13px var(--font); color: var(--ink); background: #fff;
}
.btn.primary {
  background: var(--blue); border-color: transparent; color: #fff;
}
.btn.ghost { background: transparent; }
.link {
  background: none; border: none; color: var(--blue); cursor: pointer;
  font: inherit; text-decoration: none; padding: 0;
}

.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem; margin: 1.1rem 0;
}
.kpi {
  text-align: left; background: #f7fafa; border: 1px solid var(--line);
  border-radius: 12px; padding: 0.9rem; cursor: pointer; color: inherit; font: inherit;
}
.kpi:hover { border-color: var(--teal); }
.kpi .label { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.kpi .value { font-size: 1.45rem; font-weight: 800; margin-top: 0.25rem; color: var(--navy); }
.kpi.warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.kpi.danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }

.row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.action-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}
.action-card {
  background: #f7fafa;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  border-left: 4px solid var(--teal);
}
.action-card.prio-1 { border-left-color: var(--danger); }
.action-card.prio-2 { border-left-color: var(--warn); }
.action-card.prio-3 { border-left-color: #8a6d3b; }
.action-card-top { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.action-card h4 { margin: 0; font-size: 0.95rem; letter-spacing: -.02em; }
.action-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 0.6rem; margin-top: 0.7rem;
}
.action-links { display: flex; gap: 0.7rem; }

.timeline-panel { margin: 0.4rem 0 1rem; }
.timeline {
  display: flex; align-items: flex-end; gap: 0.7rem;
  min-height: 120px; padding-top: 0.5rem;
}
.timeline-bar {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 0.35rem; min-width: 0;
}
.timeline-fill {
  width: 100%; max-width: 42px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  border-radius: 8px 8px 4px 4px;
  min-height: 8px;
}
.timeline-label { font-size: 0.72rem; font-weight: 800; color: var(--muted); }
.timeline-count { font-size: 0.7rem; color: var(--ink); font-weight: 700; }

.stack-btn {
  width: 100%; background: transparent; border: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
}
.stack-btn:hover { color: var(--blue); }

.detail-card.highlight {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, #eef7f6, #f7fafa);
  border-color: color-mix(in srgb, var(--teal) 35%, var(--line));
}

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.subpanel {
  background: #f7fafa; border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem;
}
.subpanel h3 { margin: 0 0 0.7rem; font-size: 0.95rem; }
.stack { display: flex; flex-direction: column; gap: 0.55rem; }
.stack-item {
  display: flex; justify-content: space-between; gap: 0.7rem;
  padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-size: 0.9rem;
}
.stack-item:last-child { border-bottom: 0; }

.filters {
  display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1rem; align-items: center;
}
.filters input, .filters select, .invite-form input, .invite-form select, table select {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink); padding: 0.55rem 0.7rem; font: inherit;
}
.filters input[type="search"] { min-width: 220px; flex: 1; }
.check { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); font-size: 0.85rem; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.75rem 0.45rem; border-bottom: 1px solid var(--line); }
th {
  color: var(--muted); font-weight: 800; font-size: 10px; text-transform: uppercase;
}
.badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 999px;
  border: 1px solid var(--line); font-size: 0.72rem; color: var(--blue); background: #e8f3f2;
}
.badge.warn { color: #9b5e0a; background: #fff2df; border-color: transparent; }
.badge.danger { color: #fff; background: var(--danger); border-color: transparent; }
.pill {
  display: inline-block; padding: 0.25rem 0.7rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 800;
}
.pill.green { background: #e4f3ec; color: var(--ok); }

.invite-box {
  margin: 1rem 0 1.2rem; padding: 1rem; border: 1px solid var(--line);
  border-radius: 12px; background: #f7fafa;
}
.invite-box h3 { margin: 0 0 0.35rem; }
.invite-form {
  display: grid; grid-template-columns: 1fr 1.3fr 0.9fr auto;
  gap: 0.7rem; align-items: end; margin-top: 0.8rem;
}
.invite-form label {
  display: flex; flex-direction: column; gap: 0.35rem;
  font-size: 0.8rem; color: var(--muted); font-weight: 600;
}

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; margin-top: 1rem;
}
.detail-card {
  background: #f7fafa; border: 1px solid var(--line); border-radius: 10px; padding: 0.9rem;
}
.detail-card h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.detail-card p { margin: 0.3rem 0; font-size: 0.9rem; }

@media (max-width: 900px) {
  .sidebar { width: 78px; padding: 16px 10px; }
  .sidebar-user-text, .sidebar-actions, .sidebar-foot, .sidebar-email { display: none; }
  .sidebar-user { align-items: center; border: 0; padding: 0; }
  .sidebar-user img { width: 36px; height: 36px; }
  .sidebar-nav .nav-btn, .sidebar-toggle { justify-content: center; padding: 12px; }
  .sidebar .nav-txt { display: none; }
  .content { margin-left: 78px; padding: 20px; }
  .split-2, .detail-grid { grid-template-columns: 1fr; }
  .invite-form { grid-template-columns: 1fr; }
}

/* Exclusao de contrato */
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(0.92); }
.btn.danger:disabled { opacity: 0.6; cursor: wait; }
.modal-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(20, 42, 54, 0.55); }
.modal-card { width: min(480px, 100%); background: var(--white); color: var(--ink); border-radius: 14px; padding: 22px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal-card h3 { margin: 0 0 6px; }
.modal-card p { margin: 0 0 12px; line-height: 1.5; }
.modal-label { display: block; font-weight: 600; margin-bottom: 6px; }
.modal-card textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.modal-actions { justify-content: flex-end; margin-top: 14px; }

/* Inserir contrato (leva ao Portal SSOT) */
.header-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.btn-inserir { text-decoration: none; white-space: nowrap; }
.nav-link { display: block; text-decoration: none; }

/* ===== Carteira por empresa ===== */
.carteira-panel { background: linear-gradient(135deg, #ffffff 0%, #f1f8f8 100%); }
.carteira-total { color: var(--muted); font-size: 14px; }
.carteira-total b { color: var(--ink); }
.carteira-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.emp-card {
  position: relative; display: flex; flex-direction: column; gap: 8px; text-align: left; font: inherit; color: var(--ink);
  background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 14px; cursor: pointer; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20,42,54,.04); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  animation: empIn .45s ease both;
}
.emp-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--emp-cor); }
.emp-card::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: var(--emp-cor); opacity: .06; transition: opacity .2s; }
.emp-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20,42,54,.12); border-color: color-mix(in srgb, var(--emp-cor) 40%, var(--line)); }
.emp-card:hover::after { opacity: .12; }
.emp-card:focus-visible { outline: 2px solid var(--emp-cor); outline-offset: 2px; }
.emp-card.vazio { cursor: default; opacity: .7; border-style: dashed; background: transparent; box-shadow: none; }
.emp-card.vazio:hover { transform: none; box-shadow: none; }
.emp-card.vazio p { margin: 0; font-size: 13px; }
@keyframes empIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.emp-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-height: 52px; }
.emp-logo { display: inline-flex; align-items: center; justify-content: flex-start; height: 48px; max-width: 150px; }
.emp-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.emp-logo.mono { justify-content: center; width: 48px; border-radius: 12px; background: var(--emp-cor); color: #fff; font-weight: 800; font-size: 17px; letter-spacing: .03em; }
.emp-logo.mini { height: 22px; max-width: 70px; vertical-align: middle; }
.emp-logo.mono.mini { width: 22px; border-radius: 6px; font-size: 9px; }
.emp-cell { display: inline-flex; align-items: center; gap: 8px; }
.emp-status { font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.emp-status.danger { background: color-mix(in srgb, var(--danger) 14%, #fff); color: var(--danger); }
.emp-status.warn { background: color-mix(in srgb, var(--warn) 18%, #fff); color: #9a6212; }
.emp-status.info { background: #eef4f6; color: var(--blue); }
.emp-status.ok { background: color-mix(in srgb, var(--ok) 14%, #fff); color: var(--ok); }
.emp-nome { font-weight: 800; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.emp-valor { font-size: 22px; font-weight: 800; letter-spacing: -.01em; display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.emp-valor small { font-size: 11px; font-weight: 600; color: var(--muted); }
.emp-share { height: 4px; border-radius: 4px; background: #e8eeee; overflow: hidden; }
.emp-share span { display: block; height: 100%; background: var(--emp-cor); border-radius: 4px; transition: width .6s ease; }
.emp-stats { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.emp-stats b { color: var(--ink); }
.emp-saude { display: flex; height: 8px; border-radius: 8px; overflow: hidden; background: #e8eeee; }
.emp-saude i { display: block; height: 100%; }
.emp-saude .s-danger { background: var(--danger); }
.emp-saude .s-warn { background: var(--warn); }
.emp-saude .s-soon { background: #e7c66b; }
.emp-saude .s-ok { background: var(--ok); }
.emp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.emp-foot b { color: var(--ink); }
.emp-qual { color: var(--emp-cor); letter-spacing: 1px; font-size: 10px; }
.emp-qual em { color: #d5dddd; font-style: normal; }
@media (prefers-reduced-motion: reduce) { .emp-card { animation: none; transition: none; } }
.emp-card > * { width: 100%; box-sizing: border-box; }

/* Alterar empresa */
.emp-linha { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.emp-escolha { display: flex; align-items: center; gap: 8px; }
.emp-escolha input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; }
.emp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 140px; overflow: auto; }
.emp-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; padding: 4px 10px 4px 4px; font: inherit; font-size: 12px; cursor: pointer; }
.emp-chip:hover { border-color: var(--teal); background: #f1f8f8; }

/* ===== Logos das empresas ===== */
.logo-form { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: 24px; }
@media (max-width: 860px) { .logo-form { grid-template-columns: 1fr; } }
.logo-campos input:not([type=color]):not([type=file]) { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; margin-bottom: 10px; }
.logo-cobre { margin: -4px 0 10px; font-size: 12px; }
.logo-cor { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.logo-cor input { width: 44px; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--white); cursor: pointer; }
.logo-cor span { font-family: ui-monospace, monospace; color: var(--muted); }
.logo-drop { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; text-align: center; padding: 22px 16px; border: 2px dashed var(--line); border-radius: 12px; cursor: pointer; margin-bottom: 12px; transition: border-color .15s, background .15s; }
.logo-drop:hover, .logo-drop:focus-visible, .logo-drop.arrastando { border-color: var(--teal); background: #f1f8f8; outline: none; }
.logo-drop.tem-arquivo { border-style: solid; border-color: var(--ok); background: color-mix(in srgb, var(--ok) 6%, #fff); }
.logo-drop span { font-size: 12px; }
.logo-previa .emp-card { cursor: default; max-width: 300px; }
.logo-previa .emp-card:hover { transform: none; }
.logo-previa-lista { margin-top: 12px; font-size: 13px; }
.logos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.logo-item { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--emp-cor); border-radius: 12px; background: var(--white); }
.logo-item-img { height: 52px; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(#f3f6f6 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 8px; padding: 4px; }
.logo-item-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.logo-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.logo-item-info b { font-size: 14px; }
.logo-item-acoes { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.link.perigo { color: var(--danger); }
.logos-sem-titulo { margin: 22px 0 8px; font-size: 15px; }
.logos-grid > p { grid-column: 1 / -1; }

/* ===== Menu lateral com icones e opcao de recolher ===== */
.sidebar, .content { transition: width .22s ease, margin-left .22s ease, padding .22s ease; }
.sidebar-nav .nav-btn { display: flex; align-items: center; gap: 10px; }
.nav-ico { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-txt { white-space: nowrap; overflow: hidden; }
.sidebar-toggle {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 1px solid #38505b; background: transparent; color: #b8c7cd;
  padding: 10px 14px; border-radius: 9px; font: 600 13px var(--font); cursor: pointer; margin-top: auto;
}
.sidebar-toggle:hover { border-color: #2aa8a6; color: #9fe3e0; }
.sidebar-toggle + .sidebar-foot { margin-top: 0; }
.menu-recolhido .sidebar-toggle svg { transform: scaleX(-1); }

body.menu-recolhido .sidebar { width: 78px; padding: 16px 10px; overflow: hidden; }
body.menu-recolhido .sidebar-user-text,
body.menu-recolhido .sidebar-actions,
body.menu-recolhido .sidebar-foot,
body.menu-recolhido .sidebar .nav-txt { display: none; }
body.menu-recolhido .sidebar-user { align-items: center; border: 0; padding: 0; }
body.menu-recolhido .sidebar-user img { width: 40px; height: 40px; }
body.menu-recolhido .sidebar-nav .nav-btn,
body.menu-recolhido .sidebar-toggle { justify-content: center; padding: 12px; }
body.menu-recolhido .content { margin-left: 78px; max-width: none; }
@media (prefers-reduced-motion: reduce) { .sidebar, .content { transition: none; } }

/* Coluna Objeto na lista de contratos: ate 3 linhas, texto completo ao passar o mouse */
.col-objeto { min-width: 260px; max-width: 420px; }
.objeto-txt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; font-size: 13px; color: var(--ink); }

/* Colunas Contrato e Contratante */
.col-contrato { min-width: 200px; max-width: 280px; }
.col-contrato b { display: block; font-size: 13px; line-height: 1.3; }
.col-contrato small, .col-parte small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.col-parte { min-width: 170px; max-width: 240px; }
.emp-cell .emp-logo { flex-shrink: 0; }
.table-wrap { overflow-x: auto; }

/* Partes do contrato (Contratante / Contratado) */
.col-parte { min-width: 190px; max-width: 260px; vertical-align: middle; }
.parte-grupo { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.tag-grupo { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); background: #e7f5f4; border-radius: 999px; padding: 2px 7px; }
.parte-nome { display: block; font-size: 13px; line-height: 1.3; }
.parte-nome.eh-grupo { font-weight: 700; }

/* ===== Condicoes do contrato ===== */
.cond-card { grid-column: 1 / -1; background: var(--white); }
.cond-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.cond-head h3 { margin: 0; }
.cond-status { font-size: 12px; align-self: center; }
.cond-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cond-grupo { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #f9fbfb; }
.cond-grupo h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.cond-item { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px dashed #e3eaea; font-size: 13px; }
.cond-item:first-of-type { border-top: 0; }
.cond-item span { color: var(--muted); }
.cond-item b { text-align: right; font-weight: 600; max-width: 60%; word-break: break-word; }
.cond-manual { font-style: normal; font-size: 10px; color: #9a6212; background: #fdf1dd; border-radius: 999px; padding: 1px 6px; }
.cond-modal { width: min(820px, 100%); max-height: 88vh; overflow: auto; }
.cond-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.cond-form fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 0; }
.cond-form legend { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); padding: 0 4px; }
.cond-campo { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.cond-campo input, .cond-campo select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font: inherit; font-size: 13px; color: var(--ink); background: var(--white); }

/* ===== Compromisso / condicoes na lista ===== */
.col-natureza { min-width: 190px; max-width: 250px; }
.nat-linha { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.nat-chip { font-size: 12px; font-weight: 700; background: #eef4f6; color: var(--navy); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
.nat-chip.vazio { font-weight: 600; color: var(--muted); background: #f3f6f6; }
.dir { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.dir-pagar { background: color-mix(in srgb, var(--danger) 12%, #fff); color: var(--danger); }
.dir-receber { background: color-mix(in srgb, var(--ok) 13%, #fff); color: var(--ok); }
.objeto-mini { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12px; color: var(--muted); line-height: 1.3; }
.col-comp { min-width: 170px; }
.comp-mensal { font-weight: 800; font-size: 14px; white-space: nowrap; }
.comp-mensal small { font-weight: 600; color: var(--muted); font-size: 11px; margin-left: 2px; }
.comp-saldo { font-size: 12px; color: var(--muted); margin-top: 1px; }
.comp-saldo b { color: var(--ink); }
.comp-barra { height: 5px; background: #e8eeee; border-radius: 5px; overflow: hidden; margin: 6px 0 3px; }
.comp-barra span { display: block; height: 100%; border-radius: 5px; }
.comp-prazo { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.col-cond { min-width: 200px; max-width: 280px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11px; font-weight: 600; border-radius: 6px; padding: 3px 7px; background: #f1f5f5; color: var(--ink); white-space: nowrap; max-width: 240px; overflow: hidden; text-overflow: ellipsis; cursor: default; }
.chip-gar { background: #e9f5ef; color: #1f6e55; }
.chip-gar-sem { background: #fdf1dd; color: #9a6212; }
.chip-inad { background: color-mix(in srgb, var(--danger) 10%, #fff); color: var(--danger); }
.chip-juros { background: #eef1fb; color: #3a4f9a; }
.col-gestor { white-space: nowrap; }
.gestor { display: inline-flex; align-items: center; gap: 6px; }
.gestor-av { width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.gestor-nome { font-size: 12.5px; }
.gestor-definir { font-size: 12px; }
.col-acoes { white-space: nowrap; }
.col-acoes .link + .link { margin-left: 10px; }

/* ===== Painel: endividamento ===== */
.divida-panel { background: linear-gradient(135deg, #ffffff 0%, #fbf4f4 100%); }
.divida-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dk { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.dk span { font-size: 12px; color: var(--muted); font-weight: 600; }
.dk b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.dk small { font-size: 11px; color: var(--muted); }
.dk-main { background: var(--navy); border-color: var(--navy); }
.dk-main span, .dk-main small { color: #b8c7cd; }
.dk-main b { color: #fff; font-size: 26px; }
.dk-warn { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.dk-warn b { color: #9a6212; }
.divida-nat { margin-top: 16px; }
.divida-barra { display: flex; height: 12px; border-radius: 12px; overflow: hidden; background: #e8eeee; }
.divida-barra span { display: block; height: 100%; }
.divida-legenda { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.divida-legenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.divida-legenda b { color: var(--ink); }
.divida-prox { margin-top: 12px; font-size: 13px; }
.divida-obs { margin: 8px 0 0; font-size: 12px; }

/* ===== Tipo (Endividamento/Investimento/Receita) e filtros rapidos ===== */
.tipo-tag { display: inline-block; font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; border-radius: 6px; padding: 2px 7px; margin-bottom: 5px; cursor: pointer; }
.tipo-endividamento { background: color-mix(in srgb, var(--danger) 13%, #fff); color: var(--danger); }
.tipo-investimento { background: #fdf1dd; color: #9a6212; }
.tipo-receita { background: color-mix(in srgb, var(--ok) 14%, #fff); color: var(--ok); }
.nat-chip[data-fac], .chip[data-fac] { cursor: pointer; }
.nat-chip[data-fac]:hover, .chip[data-fac]:hover, .tipo-tag:hover { outline: 2px solid color-mix(in srgb, var(--teal) 45%, transparent); }
.fchip { font: inherit; font-size: 12px; border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 999px; padding: 3px 4px 3px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.fchip em { font-style: normal; font-size: 11px; font-weight: 700; background: #eef3f3; color: var(--muted); border-radius: 999px; padding: 1px 7px; }
.fchip:hover { border-color: var(--teal); }
.fchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.fchip.on em { background: rgba(255,255,255,.18); color: #fff; }
.fchip.zero { opacity: .45; }

/* ===== Barra da lista: abas compactas, busca, filtros recolhidos ===== */
.lista-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.seg { display: inline-flex; background: #eef3f3; border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); background: transparent; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.seg-btn em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); background: rgba(20,42,54,.07); border-radius: 999px; padding: 1px 7px; }
.seg-btn:hover { color: var(--ink); }
.seg-btn.ativa { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(20,42,54,.12); }
.seg-btn.ativa.seg-endividamento { color: var(--danger); }
.seg-btn.ativa.seg-investimento { color: #9a6212; }
.seg-btn.ativa.seg-receita { color: var(--ok); }
.lista-busca { display: flex; gap: 8px; flex: 1 1 320px; justify-content: flex-end; }
.lista-busca input { flex: 1; max-width: 360px; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 13px; background: var(--white); }
.lista-busca input:focus { outline: none; border-color: var(--teal); }
.btn-filtros { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.btn-filtros svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.btn-filtros.aberto { background: var(--navy); color: #fff; border-color: var(--navy); }
.facetas { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; background: var(--white); box-shadow: 0 8px 24px rgba(20,42,54,.06); }
.facetas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 22px; }
.faceta { display: flex; flex-direction: column; gap: 6px; }
.faceta-tit { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.faceta-ops { display: flex; flex-wrap: wrap; gap: 5px; }
.filtros-ativos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.filtros-ativos:empty { display: none; }
.pill { font: inherit; font-size: 12px; color: var(--ink); background: #e7f5f4; border: 1px solid #c9e8e5; border-radius: 999px; padding: 4px 8px 4px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pill b { font-weight: 700; }
.pill span { font-size: 14px; line-height: 1; color: var(--muted); }
.pill:hover { border-color: var(--danger); }
.pill:hover span { color: var(--danger); }
.pill-painel { background: #eef1fb; border-color: #d6dcf3; }
.limpar-tudo { font-size: 12px; margin-left: 4px; }
.lista-resumo { font-size: 12.5px; color: var(--muted); margin: 2px 2px 8px; }
.lista-resumo b { color: var(--ink); }
.lista-resumo .sep { margin: 0 8px; color: #c3cfd2; }

/* Atributo hidden sempre vence o display dos componentes */
/* Inserir contrato (cadastro no proprio painel) */
.cad-card { width: min(760px, 100%); max-height: 92vh; overflow: auto; }
.cad-drop { display: grid; justify-items: center; gap: 6px; margin: 14px 0 4px; padding: 34px 18px; text-align: center; border: 2px dashed var(--line); border-radius: 14px; cursor: pointer; background: linear-gradient(180deg, #f8fbfb, #eef6f6); transition: border-color .2s, background .2s; }
.cad-drop:hover, .cad-drop:focus-visible, .cad-drop.sobre { border-color: var(--teal); background: #e6f4f3; outline: none; }
.cad-drop b { font-size: 16px; }
.cad-doc { width: 52px; height: 52px; color: var(--blue); animation: cad-flutua 2.6s ease-in-out infinite; }
@keyframes cad-flutua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.cad-lendo { display: grid; justify-items: center; gap: 8px; padding: 40px 10px; text-align: center; }
.cad-spin { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--teal); animation: cad-gira .9s linear infinite; }
@keyframes cad-gira { to { transform: rotate(360deg); } }
.cad-arq { font-weight: 600; word-break: break-all; }
.cad-aviso { padding: 8px 10px; border-radius: 8px; background: #fff6e8; color: #7a5212; }
.cad-aviso.ok { background: #e8f6f1; color: var(--ok); }
.cad-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cad-campo { display: grid; gap: 5px; align-content: start; }
.cad-campo.larga { grid-column: 1 / -1; }
.cad-campo label { font-weight: 600; font-size: 13px; }
.cad-campo input, .cad-campo select, .cad-campo textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; color: var(--ink); background: var(--white); }
.cad-campo textarea { resize: vertical; }
.cad-ia { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .06em; color: var(--teal); background: #e3f4f3; border-radius: 6px; padding: 1px 5px; margin-left: 4px; }
.cad-rel { position: relative; }
.cad-sug { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; max-height: 220px; overflow: auto; margin-top: 2px; background: var(--white); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.cad-sug button { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; background: none; font: inherit; cursor: pointer; }
.cad-sug button:hover { background: #eef6f6; }
.cad-sug-vazio { padding: 8px 10px; color: var(--muted); }
.cad-pronto { display: grid; justify-items: center; text-align: center; padding: 16px 0 4px; }
.cad-check { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 28px; font-weight: 800; margin-bottom: 8px; }
@media (max-width: 700px) { .cad-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .cad-doc, .cad-spin { animation: none; } }
/* Inserir contrato — telas animadas (mesma linguagem do Portal SSOT) */
.cad-card.fx-modo { width: min(640px, 100%); padding: 0; background: #050b14; overflow: hidden; }
.fx-painel { position: relative; overflow: hidden; border-radius: 14px; color: #dff7fb; background-color: #050b14;
  background-image: linear-gradient(rgba(34,211,238,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(34,211,238,.07) 1px, transparent 1px);
  background-size: 28px 28px; --fx: #22d3ee; --fx-claro: #a5f3fc; --fx-forte: 34,211,238; }
.fx-painel.ambar { background-color: #0d0a05; --fx: #fbbf24; --fx-claro: #fde68a; --fx-forte: 251,191,36;
  background-image: linear-gradient(rgba(251,191,36,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(251,191,36,.06) 1px, transparent 1px); }
.fx-painel.verde { --fx: #34d399; --fx-claro: #a7f3d0; --fx-forte: 52,211,153; }
.fx-painel::before, .fx-painel::after { content: ""; position: absolute; left: 0; right: 0; height: 1px; pointer-events: none; background: linear-gradient(90deg, transparent, var(--fx), transparent); }
.fx-painel::before { top: 0; } .fx-painel::after { bottom: 0; background: linear-gradient(90deg, transparent, var(--teal), transparent); }
.fx-fechar { position: absolute; z-index: 3; top: 10px; right: 12px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: rgba(255,255,255,.06); color: #9fb3bd; font-size: 20px; line-height: 1; cursor: pointer; }
.fx-fechar:hover { background: rgba(255,255,255,.14); color: #fff; }
.fx-centro { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 400px; padding: 44px 28px; text-align: center; }
.fx-entra { animation: fx-surge .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fx-surge { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

.fx-nucleo { position: relative; width: var(--t); height: var(--t); display: grid; place-items: center; flex: none; }
.fx-nucleo > i { position: absolute; border-radius: 50%; }
.fx-brilho { inset: 0; background: rgba(var(--fx-forte), .22); filter: blur(22px); animation: fx-pulsa 2.4s ease-in-out infinite; }
.fx-anel.a1 { inset: 0; border: 1px solid rgba(var(--fx-forte), .3); border-top-color: var(--fx-claro); border-right-color: transparent; animation: fx-gira 3.2s linear infinite; }
.fx-anel.a2 { inset: 14%; border: 1px dashed rgba(var(--fx-forte), .45); animation: fx-gira 6s linear infinite reverse; }
.fx-anel.a3 { inset: 28%; border: 1px solid rgba(42,168,166,.6); border-bottom-color: transparent; animation: fx-gira 2.2s linear infinite; }
.fx-nucleo.ocupado .fx-anel.a1 { animation-duration: 1.1s; } .fx-nucleo.ocupado .fx-anel.a2 { animation-duration: 2s; } .fx-nucleo.ocupado .fx-anel.a3 { animation-duration: .8s; }
.fx-doc { position: relative; width: 34%; height: 34%; display: grid; place-items: center; overflow: hidden; border-radius: 12px; color: var(--fx-claro);
  background: rgba(var(--fx-forte), .1); box-shadow: 0 0 0 1px rgba(var(--fx-forte), .6), 0 0 30px rgba(var(--fx-forte), .45); animation: fx-flutua 3s ease-in-out infinite; }
.fx-doc svg { width: 55%; height: 55%; }
.fx-scan { position: absolute; left: 0; right: 0; height: 1px; background: #cffafe; box-shadow: 0 0 10px 2px rgba(103,232,249,.9); animation: fx-varre 2s ease-in-out infinite; }
.fx-nucleo.ocupado .fx-scan { animation-duration: 1s; }
@keyframes fx-gira { to { transform: rotate(360deg); } }
@keyframes fx-pulsa { 0%, 100% { opacity: .35; } 50% { opacity: .85; } }
@keyframes fx-flutua { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes fx-varre { 0% { top: 0; opacity: 0; } 10%, 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }

.fx-marca { margin: 30px 0 0; font: 600 11px/1 ui-monospace, Consolas, monospace; letter-spacing: .35em; text-transform: uppercase; color: rgba(165,243,252,.8); }
.fx-linha { height: 22px; margin-top: 12px; font: 13px ui-monospace, Consolas, monospace; color: #e0fbff; }
.fx-digita { display: inline-block; overflow: hidden; white-space: nowrap; border-right: 2px solid var(--fx-claro); padding-right: 3px; animation: fx-digitar .7s steps(32) both; }
@keyframes fx-digitar { from { width: 0; } to { width: 100%; } }
.fx-progresso { width: 230px; height: 4px; margin-top: 22px; overflow: hidden; border-radius: 99px; background: rgba(var(--fx-forte), .12); }
.fx-progresso i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--fx-claro), var(--teal)); transition: width .7s ease-out; }
.fx-progresso.vai i { width: 34%; background: linear-gradient(90deg, transparent, var(--fx-claro), transparent); animation: fx-corre 1.4s ease-in-out infinite; }
@keyframes fx-corre { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.fx-drop { cursor: pointer; transition: background .3s; outline: none; }
.fx-borda { position: absolute; inset: 16px; border: 2px dashed rgba(34,211,238,.25); border-radius: 12px; pointer-events: none; transition: border-color .3s, box-shadow .3s; }
.fx-drop:hover .fx-borda, .fx-drop:focus-visible .fx-borda { border-color: rgba(34,211,238,.55); }
.fx-drop.sobre { background: rgba(34,211,238,.09); }
.fx-drop.sobre .fx-borda { border-color: #67e8f9; box-shadow: inset 0 0 40px rgba(34,211,238,.18); }
.fx-titulo { margin: 24px 0 0; font-size: 26px; font-weight: 700; letter-spacing: .02em; color: transparent;
  background: linear-gradient(90deg, #a5f3fc, #fff, #a5f3fc); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; animation: fx-brilha-texto 4s linear infinite; }
.fx-painel.ambar .fx-titulo { background-image: linear-gradient(90deg, #fde68a, #fff, #fde68a); }
.fx-painel.verde .fx-titulo { background-image: linear-gradient(90deg, #a7f3d0, #fff, #a7f3d0); }
.fx-titulo.pequeno { font-size: 21px; margin-top: 22px; }
@keyframes fx-brilha-texto { to { background-position: -200% center; } }
.fx-texto { max-width: 430px; margin: 8px 0 0; color: #b6c6cf; font-size: 14px; line-height: 1.55; }
.fx-dica { margin: 6px 0 0; font: 11px ui-monospace, Consolas, monospace; letter-spacing: .08em; text-transform: uppercase; color: rgba(165,243,252,.6); }
.fx-arquivo { max-width: 90%; margin: 6px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12px ui-monospace, Consolas, monospace; color: var(--fx-claro); }
.fx-botao { display: inline-flex; align-items: center; gap: 8px; margin-top: 26px; padding: 10px 20px; border: 0; border-radius: 10px; cursor: pointer;
  font: 700 14px var(--font); color: #04212a; background: linear-gradient(135deg, #67e8f9, var(--teal)); box-shadow: 0 0 24px rgba(34,211,238,.35); transition: transform .2s, box-shadow .2s; }
.fx-botao:hover, .fx-drop:hover .fx-botao { transform: translateY(-2px); box-shadow: 0 0 34px rgba(34,211,238,.55); }
.fx-botao.ambar { color: #2a1a00; background: linear-gradient(135deg, #fde68a, #f59e0b); box-shadow: 0 0 24px rgba(251,191,36,.35); }
.fx-botao.vazado { color: var(--fx-claro); background: transparent; box-shadow: inset 0 0 0 1px rgba(var(--fx-forte), .5); }
.fx-painel.verde .fx-botao:not(.vazado) { color: #032015; background: linear-gradient(135deg, #a7f3d0, #10b981); box-shadow: 0 0 24px rgba(52,211,153,.35); }
.fx-acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; } .fx-acoes .fx-botao { margin-top: 22px; }
.fx-erro { margin: 16px 0 0; padding: 8px 12px; border-radius: 8px; color: #fecaca; background: rgba(239,68,68,.12); box-shadow: inset 0 0 0 1px rgba(239,68,68,.35); }

.fx-etapas { margin: 22px 0 0; padding: 0; list-style: none; text-align: left; font: 12px/1 ui-monospace, Consolas, monospace; }
.fx-etapas li { display: flex; align-items: center; gap: 9px; padding: 4px 0; color: #4b5b66; transition: color .5s; }
.fx-etapas li::before { content: ""; width: 12px; height: 12px; flex: none; border-radius: 50%; border: 1px solid #4b5b66; box-sizing: border-box; }
.fx-etapas li.agora { color: #e0fbff; }
.fx-etapas li.agora::before { border-color: var(--fx-claro); border-right-color: transparent; animation: fx-gira .8s linear infinite; }
.fx-etapas li.feito { color: rgba(165,243,252,.75); }
.fx-etapas li.feito::before { content: "✓"; border: 0; color: var(--fx-claro); font-size: 12px; line-height: 12px; text-align: center; }
.fx-painel.verde .fx-etapas li.feito { color: rgba(167,243,208,.85); }

.fx-alerta { position: relative; display: grid; place-items: center; width: 80px; height: 80px; border-radius: 18px; color: #fcd34d;
  background: rgba(251,191,36,.1); box-shadow: 0 0 0 1px rgba(252,211,77,.6), 0 0 30px rgba(251,191,36,.35); animation: fx-flutua 3s ease-in-out infinite; }
.fx-alerta svg { width: 42px; height: 42px; }
.fx-alerta b { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fbbf24; color: #000; font-size: 14px; }
.fx-ficha { width: min(440px, 100%); margin-top: 18px; padding: 14px 16px; text-align: left; border-radius: 10px; background: rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(251,191,36,.2); }
.fx-ficha b { color: #fff; } .fx-ficha code { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgba(253,230,138,.8); font-size: 12px; }
.fx-ficha p { margin: 8px 0 0; color: #94a3b8; font-size: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fx-ficha small { display: block; margin-top: 8px; color: #64748b; }

.fx-ok { position: relative; display: grid; place-items: center; width: 96px; height: 96px; }
.fx-ok i { position: absolute; inset: 0; border-radius: 50%; background: rgba(52,211,153,.25); animation: fx-onda 1.8s ease-out infinite; }
.fx-ok svg { position: relative; width: 72px; height: 72px; padding: 16px; box-sizing: border-box; border-radius: 50%; background: #10b981; box-shadow: 0 0 34px rgba(52,211,153,.6);
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: fx-risca .6s .25s ease-out forwards, fx-surge .5s both; }
@keyframes fx-onda { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@keyframes fx-risca { to { stroke-dashoffset: 0; } }

/* Formulário de conferência: entra deslizando, campos em cascata, preenchidos pela IA em destaque */
.cad-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cad-topo h3 { margin: 0; }
.cad-topo .cad-arq { margin: 2px 0 0; font-weight: 500; color: var(--muted); font-size: 12px; }
.cad-topo-icone { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 12px; color: #0e7490; background: linear-gradient(135deg, #cffafe, #e0f2f1); box-shadow: 0 0 0 1px #a5f3fc, 0 6px 18px rgba(34,211,238,.25); }
.cad-topo-icone svg { width: 24px; height: 24px; }
.cad-escalona .cad-campo { animation: fx-sobe .45s cubic-bezier(.2,.8,.2,1) both; }
@keyframes fx-sobe { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.cad-ia-campo input, .cad-ia-campo select, .cad-ia-campo textarea { border-color: #67e8f9; background: linear-gradient(180deg, #f0fdff, #fff); animation: fx-realce 1.6s ease-out .4s 1 both; }
@keyframes fx-realce { 0% { box-shadow: 0 0 0 0 rgba(34,211,238,.55); } 100% { box-shadow: 0 0 0 8px rgba(34,211,238,0); } }
.cad-ia { background: linear-gradient(135deg, #cffafe, #a5f3fc); color: #0e7490; box-shadow: 0 0 10px rgba(34,211,238,.35); }

/* Formulário de conferência: escuro, limpo e nítido (sem grade, sem brilho) */
.cad-card.fx-modo:has(.fx-form) { width: min(760px, 100%); max-height: 92vh; overflow: auto; background: #0b131c; }
.fx-painel.fx-form { background: #0b131c; background-image: none; }
.fx-form::before { background: linear-gradient(90deg, transparent, rgba(34,211,238,.6), transparent); }
.fx-form::after { display: none; }
.fx-form-corpo { position: relative; padding: 24px 28px 22px; }
.fx-form .cad-topo { margin-bottom: 14px; }
.fx-form .cad-topo h3 { color: #f1f7f9; font-size: 18px; font-weight: 700; }
.fx-form .cad-topo .cad-arq { color: #6f8a95; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.fx-form .cad-topo-icone { width: 40px; height: 40px; color: #67e8f9; background: #102230; box-shadow: none; border: 1px solid #1d3a48; }
.fx-form .cad-aviso { margin: 0 0 16px; padding: 0; background: none; box-shadow: none; color: #e5c07b; font-size: 13px; }
.fx-form .cad-aviso.ok { color: #8fb9c3; display: flex; align-items: center; gap: 8px; }
.cad-ponto { width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; flex: none; }
.fx-form .cad-grid { gap: 14px 16px; }
.cad-secao { grid-column: 1 / -1; margin-top: 6px; padding-top: 14px; border-top: 1px solid #1a2733; color: #c9d6dc; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cad-secao span { margin-left: 6px; color: #56707b; font-weight: 600; letter-spacing: .04em; text-transform: none; }
.fx-form .cad-campo label { display: flex; align-items: center; gap: 6px; color: #8ea3ad; font-size: 12px; font-weight: 600; }
.fx-form .cad-campo input, .fx-form .cad-campo select, .fx-form .cad-campo textarea { color: #eef5f7; background: #0f1a24; border: 1px solid #22313e; border-radius: 8px; padding: 9px 11px; box-shadow: none; animation: none; transition: border-color .15s; }
.fx-form .cad-campo textarea { line-height: 1.5; }
.fx-form .cad-campo select option { background: #0f1a24; color: #eef5f7; }
.fx-form .cad-campo input::placeholder { color: #4f6570; }
.fx-form .cad-campo input:hover, .fx-form .cad-campo select:hover, .fx-form .cad-campo textarea:hover { border-color: #2f4554; }
.fx-form .cad-campo input:focus, .fx-form .cad-campo select:focus, .fx-form .cad-campo textarea:focus { outline: none; border-color: #22d3ee; }
.fx-form .cad-ia-campo input, .fx-form .cad-ia-campo select, .fx-form .cad-ia-campo textarea { border-color: #1e4a58; background: #0f1a24; }
.fx-form .cad-ia { margin: 0; padding: 0 5px; border-radius: 4px; font-size: 9px; line-height: 15px; letter-spacing: .08em; color: #67e8f9; background: rgba(34,211,238,.1); box-shadow: none; }
.fx-form .cad-campo input[type="file"] { padding: 6px; color: #8ea3ad; }
.fx-form .cad-campo input[type="file"]::file-selector-button { margin-right: 10px; padding: 6px 12px; border: 1px solid #2a3d4b; border-radius: 6px; background: #142230; color: #d6e6ec; font: 600 12px var(--font); cursor: pointer; }
.fx-form .cad-sug { background: #0f1a24; border-color: #2a3d4b; box-shadow: 0 14px 30px rgba(0,0,0,.5); }
.fx-form .cad-sug button { color: #eef5f7; } .fx-form .cad-sug button:hover { background: #16283a; }
.fx-form .msg.err { color: #fca5a5; }
.fx-form .modal-actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid #1a2733; }
.fx-form .modal-actions .btn { border-radius: 8px; }
.fx-form .modal-actions .btn.ghost { color: #b9cbd2; border: 1px solid #2a3d4b; background: transparent; }
.fx-form .modal-actions .btn.ghost:hover { background: #122130; color: #fff; }
.fx-form .modal-actions .btn.primary { border: 0; color: #04212a; background: #22d3ee; box-shadow: none; }
.fx-form .modal-actions .btn.primary:hover { background: #67e8f9; }
.fx-form .fx-fechar { top: 16px; right: 16px; }
.fx-etapas.pronto + .fx-texto { margin-top: 14px; }
@media (max-width: 560px) { .fx-centro { min-height: 360px; padding: 40px 18px; } .fx-titulo { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) { .fx-painel *, .fx-painel *::before, .cad-escalona .cad-campo { animation: none !important; } .fx-ok svg { stroke-dashoffset: 0; } }
/* Escolha do gestor */
button.gestor { border: 0; background: none; padding: 2px 6px 2px 2px; border-radius: 99px; cursor: pointer; font: inherit; color: inherit; }
button.gestor:hover { background: #e9f3f3; }
.gestor-card { width: min(440px, 100%); }
.gestor-busca { width: 100%; margin: 4px 0 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.gestor-lista { display: grid; gap: 4px; max-height: 320px; overflow: auto; }
.gestor-op { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: background .15s, border-color .15s; }
.gestor-op:hover { background: #eef6f6; border-color: var(--line); }
.gestor-op.sel { border-color: var(--teal); background: #e7f5f4; }
.gestor-op .gestor-av { width: 32px; height: 32px; flex: none; }
.gestor-op-txt { display: grid; min-width: 0; } .gestor-op-txt small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gestor-op em { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; color: var(--teal); }
/* Subcategoria que abre quando o Tipo e "A Pagar" */
.cad-sub { border-left: 2px solid #2aa8a6; padding-left: 12px; animation: cadSubAbre .25s ease-out; }
.cad-ajuda { font-size: 12px; opacity: .7; line-height: 1.35; min-height: 1em; }
@keyframes cadSubAbre { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Aditivos */
.aditivos-card { grid-column: 1 / -1; }
.aditivo-lista { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .6rem; }
.aditivo-lista li { border: 1px solid var(--line); border-left: 3px solid #237a8b; border-radius: 8px; padding: .6rem .8rem; }
.aditivo-lista p { margin: .35rem 0; }
.aditivo-topo { display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; }
.aditivo-acoes { margin-left: auto; display: flex; gap: .8rem; }
.link.perigo { color: #b94c55; }
.aditivo-badge { display: inline-block; margin-left: .4rem; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: rgba(35,122,139,.12); color: #237a8b; white-space: nowrap; }
.aditivo-modal { max-width: 560px; }
.cad-aditivo-opcao { display: flex; gap: .55rem; align-items: center; margin: 0 0 .9rem; padding: .55rem .75rem; border: 1px dashed rgba(42,168,166,.5); border-radius: 8px; cursor: pointer; font-size: 13px; }
.cad-aditivo-opcao input { accent-color: #2aa8a6; width: 16px; height: 16px; }

[hidden] { display: none !important; }
