:root {
  --navy: #0d1b2a;
  --navy-2: #08121d;
  --navy-soft: #e8eef6;
  --green: #1f8a4c;
  --green-hover: #187240;
  --amber: #c27c0e;
  --amber-soft: #fff4e0;
  --red: #c93636;
  --red-soft: #fdecec;
  --blue: #2563c9;
  --blue-soft: #e7effc;
  --violet: #4b3fb5;
  --violet-soft: #eeecfb;
  --bg: #f4f5f9;
  --surface: #ffffff;
  --border: #e3e6ee;
  --text: #1f2433;
  --muted: #6b7286;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 480px) 1fr; }
.login-form { background: var(--surface); padding: 48px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form .brand { margin-bottom: 36px; }
.login-form h1 { font-size: 22px; margin: 0 0 4px; }
.login-form p.sub { color: var(--muted); margin: 0 0 26px; }
.login-side {
  background: linear-gradient(135deg, var(--navy) 0%, #24405f 100%);
  color: #fff; display: flex; align-items: center; padding: 56px; position: relative; overflow: hidden;
}
.login-side h2 { font-size: clamp(28px, 3.4vw, 46px); line-height: 1.15; margin: 0 0 18px; font-weight: 700; max-width: 14ch; }
.login-side p { font-size: 17px; opacity: .85; max-width: 42ch; margin: 0; }
.login-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.login-side li::before { content: "✓"; display: inline-block; width: 22px; color: #8fd6ad; font-weight: 700; }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .login-form { padding: 40px 20px; min-height: 100vh; }
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 10px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.brand-name { font-weight: 700; font-size: 17px; line-height: 1.1; }
.brand-name small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .02em; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #dbe3ef; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 22px 20px; color: #fff; }
.side .brand-mark { background: #fff; color: var(--navy); }
.side .brand-name small { color: #a9b8cf; }
.nav { display: flex; flex-direction: column; padding: 8px 10px; gap: 2px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 9px;
  color: #dbe3ef; text-decoration: none; font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.active { background: rgba(255,255,255,.13); color: #fff; font-weight: 600; }
.nav a .badge { margin-left: auto; background: #f0b44c; color: #3a2600; border-radius: 99px; font-size: 12px; font-weight: 700; padding: 1px 8px; }
.nav svg { width: 19px; height: 19px; flex: none; }
.side-foot { padding: 16px 20px; font-size: 13px; color: #a9b8cf; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot strong { color: #fff; display: block; font-size: 14px; }
.side-foot button { margin-top: 10px; background: none; border: 1px solid rgba(255,255,255,.2); color: #dbe3ef; border-radius: 8px; padding: 6px 12px; cursor: pointer; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 28px; position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 18px; margin: 0; font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-select { max-width: 340px; }
.content { padding: 24px 28px 64px; max-width: 1280px; width: 100%; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--navy); }
.menu-btn svg { width: 24px; height: 24px; display: block; }
.btn svg { width: 16px; height: 16px; flex: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(10,20,40,.45); }
  .menu-btn { display: block; }
  .topbar { padding: 0 16px; gap: 10px; }
  .content { padding: 16px 16px 64px; }
  .company-select { max-width: 46vw; }
}

/* ---------- Componentes ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card h2 { font-size: 17px; margin: 0 0 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card h2 .spacer { flex: 1; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 20px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 16px; border-radius: 9px; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: #f6f7fb; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green-hover); }
.btn.navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn { background: none; border: 0; cursor: pointer; padding: 6px; border-radius: 7px; color: var(--muted); display: inline-grid; place-items: center; }
.icon-btn:hover { background: #eef0f5; color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

label.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #3a4155; }
label.field .hint { font-weight: 400; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; border: 1px solid #d5d9e3; border-radius: 9px; padding: 10px 12px; background: #fff; font-size: 15px;
}
.input:focus { outline: 2px solid #b9cdea; border-color: var(--navy); }
textarea.input { min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--green); }
.err { color: var(--red); font-size: 14px; min-height: 20px; }

.tabs { display: flex; gap: 4px; background: #eef0f5; padding: 4px; border-radius: 10px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 7px; cursor: pointer; font-weight: 500; color: var(--muted); white-space: nowrap; }
.tabs button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: var(--shadow); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: #e3f4ea; color: var(--green); }
.pill.read { background: var(--violet-soft); color: var(--violet); }
.pill.wait { background: var(--amber-soft); color: var(--amber); }
.pill.err { background: var(--red-soft); color: var(--red); }
.pill.info { background: var(--blue-soft); color: var(--blue); }
.pill.gray { background: #eef0f5; color: var(--muted); }

/* Cartões de números (Gerência de envios) */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); text-align: center; cursor: pointer; }
.stat .lbl { color: #fff; font-weight: 600; font-size: 14px; padding: 7px; }
.stat .num { font-size: 40px; font-weight: 600; padding: 8px 0 12px; }
.stat.sel { outline: 3px solid #b9cdea; }
.stat.s-ok .lbl { background: var(--blue); }
.stat.s-wait .lbl { background: #7a8197; }
.stat.s-err .lbl { background: var(--red); }
.stat.s-read .lbl { background: var(--violet); }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat .num { font-size: 30px; } }

/* Tabelas */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-weight: 600; color: #3a4155; padding: 11px 12px; border-bottom: 1px solid var(--border); background: #fafbfd; white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid #eef0f5; vertical-align: top; }
table.t tr:hover td { background: #fafbfe; }
table.t tr.click { cursor: pointer; }
.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 520px; }
.nowrap { white-space: nowrap; }

/* Lista mobile para tabelas */
@media (max-width: 700px) {
  table.t.responsive thead { display: none; }
  table.t.responsive tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.t.responsive td { display: flex; gap: 10px; border: 0; padding: 4px 12px; }
  table.t.responsive td::before { content: attr(data-l); font-weight: 600; color: var(--muted); min-width: 92px; flex: none; }
}

/* Calendário */
.cal-head { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }
.cal-head strong { min-width: 170px; text-align: center; font-size: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-weight: 600; color: var(--muted); font-size: 13px; padding: 6px 0; }
.cal .day { aspect-ratio: 1 / .82; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; cursor: pointer; border: 1px solid transparent; font-weight: 500; background: none; }
.cal .day:hover { background: #f1f3f8; }
.cal .day.other { color: #c2c7d3; }
.cal .day.today { border-color: var(--navy); }
.cal .day.sel { background: var(--navy); color: #fff; }
.cal .day .dots { display: flex; gap: 3px; height: 6px; margin-top: 3px; }
.cal .day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.cal .day .dots i.done { background: var(--green); }
.cal .day.sel .dots i { background: #fff; }

.event { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid #eef0f5; }
.event:last-child { border-bottom: 0; }
.event .date { width: 48px; text-align: center; flex: none; background: var(--navy-soft); color: var(--navy); border-radius: 9px; padding: 5px 0; font-weight: 700; line-height: 1.1; }
.event .date small { display: block; font-weight: 600; font-size: 11px; text-transform: uppercase; }
.event .info { flex: 1; min-width: 0; }
.event .info strong { display: block; font-weight: 600; }

.file { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #eef0f5; }
.file:last-child { border-bottom: 0; }
.file .ico { width: 38px; height: 38px; border-radius: 9px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
.file .info { flex: 1; min-width: 0; }
.file .info strong { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Solicitações */
.req { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; color: inherit; background: #fff; }
.req:hover { border-color: #c5ccdb; background: #fbfcfe; }
.req + .req { margin-top: 10px; }
.req .top { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.req strong { font-weight: 600; }
.req .meta { font-size: 13px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thread { display: grid; gap: 14px; }
.msg { max-width: 78%; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.msg.mine { margin-left: auto; background: var(--navy-soft); border-color: #d3deec; }
.msg .who { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; word-wrap: break-word; }
.msg .att { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 640px) { .msg { max-width: 92%; } }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 25, 45, .5); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 14px; width: min(640px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal header h3 { margin: 0; font-size: 17px; flex: 1; }
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal .body { padding: 20px 22px; overflow: auto; min-height: 0; }
.modal footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.dropzone { border: 2px dashed #c9cfdc; border-radius: 12px; padding: 24px; text-align: center; color: var(--muted); cursor: pointer; background: #fafbfd; }
.dropzone.over { border-color: var(--green); background: #f0f9f3; }
.dropzone strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; justify-content: center; }
.chip { background: #eef0f5; border-radius: 99px; padding: 3px 10px; font-size: 13px; }

.notice { padding: 12px 14px; border-radius: 10px; background: var(--amber-soft); color: #6b4705; font-size: 14px; }
.notice.info { background: var(--blue-soft); color: #1d4a95; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #1f2433; color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; max-width: 90vw; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--red); }

/* logo oficial (Variação 1) */
.logo-login { width: 210px; height: auto; display: block; }
.brand-side { flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-side img { width: 150px; height: auto; display: block; }
.brand-side small { color: #8fa1b8; font-size: 11px; font-weight: 600; letter-spacing: .12em; }

/* guias em atraso / notas */
.guia, .nota { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.guia .info, .nota .info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; }
.guia .actions, .nota .actions { gap: 8px; flex-wrap: wrap; }
.guia.paid { opacity: .6; }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px 12px; margin-top: 8px; max-height: 220px; overflow: auto; padding: 4px; }
.guia-result { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.guia-result div { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--border); }
.guia-result div:first-child { border-top: 0; }
.guia-result .total { background: #e3f4ea; color: var(--green); font-size: 17px; }
.alert-guias { display: flex; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 18px; border-radius: var(--radius); background: var(--red-soft); color: var(--red); text-decoration: none; border: 1px solid #f3c7c7; flex-wrap: wrap; }
.alert-guias svg { width: 22px; height: 22px; flex: none; }
.alert-guias span { flex: 1 1 240px; color: #7a1f1f; }
.alert-guias .go { white-space: nowrap; }
.nav a[href='#/guias'] .badge { background: #e05252; color: #fff; }

/* emissão NFS-e (passo a passo) */
.wiz-steps { display: flex; gap: 6px; margin-bottom: 16px; }
.wiz-steps .ws { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #eef0f5; color: var(--muted); font-size: 13px; font-weight: 600; }
.wiz-steps .ws b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #fff; font-size: 12px; flex: none; }
.wiz-steps .ws.on { background: var(--navy); color: #fff; }
.wiz-steps .ws.on b { color: var(--navy); }
@media (max-width: 560px) { .wiz-steps .ws span { display: none; } .wiz-steps .ws { justify-content: center; } }
.modal .sec { font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 6px; margin-top: 6px; }
.modal .ro { padding: 9px 12px; background: #f6f7fa; border: 1px solid var(--border); border-radius: 9px; font-size: 14px; }
.liquido { background: #f6f7fa; border-radius: 9px; padding: 10px 14px; }
.liquido:empty { display: none; }
table.rev th { width: 38%; text-align: left; color: var(--muted); font-weight: 600; vertical-align: top; }
table.rev td, table.rev th { padding: 8px 10px; border-bottom: 1px solid var(--border); }
details summary { cursor: pointer; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; flex-wrap: wrap; }
.kv span { color: var(--muted); }
.ok-notice { background: #e3f4ea; border-color: #bfe3cc; color: #145c33; }

[hidden] { display: none !important; }

/* área do Integra Contador */
.itg-rows { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.itg-row { display: grid; grid-template-columns: 210px 1fr 96px; gap: 14px; align-items: center; }
.itg-lbl { font-size: 15px; }
.itg-bar { display: flex; height: 40px; border-radius: 4px; overflow: hidden; background: #eef0f5; }
.itg-bar > div { display: grid; place-items: center; font-weight: 600; font-size: 14px; min-width: 34px; }
.itg-bar.vazia { display: grid; place-items: center; color: #4b5563; background: #e3e6ec; font-size: 14px; }
.itg-tag { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 12.5px; font-weight: 600; margin: 2px 2px 2px 0; }
.itg-foot { display: flex; justify-content: space-between; gap: 24px; margin-top: 26px; flex-wrap: wrap; }
.itg-legenda { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.itg-custo { display: flex; gap: 0; align-items: stretch; background: #eef0f3; border-radius: 12px; padding: 16px 20px; flex-wrap: wrap; align-self: flex-start; }
.itg-custo > div { display: flex; flex-direction: column; padding: 0 18px; }
.itg-custo > div + div { border-left: 2px solid #d6dae2; }
.itg-custo span { color: #0e7a5e; font-weight: 600; font-size: 14px; max-width: 190px; }
.itg-custo b { font-size: 34px; color: #0e7a5e; }
.itg-custo a { width: 100%; text-align: right; margin-top: 8px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .itg-row { grid-template-columns: 1fr; gap: 6px; } .grid-3 { grid-template-columns: 1fr; } }

/* melhorias: gráfico, alíquota, grupos por cliente */
.grafico { width: 100%; height: auto; margin-top: 8px; }
.aliq-box { flex: 0 0 280px; background: #f3f8f5; border: 1px solid #cfe7da; border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.aliq-box .lbl { color: #0e7a5e; font-weight: 600; font-size: 13px; }
.aliq-box .num { font-size: 36px; font-weight: 700; color: #0e7a5e; line-height: 1.1; }
.aliq-box .sep { border-top: 1px solid #cfe7da; margin: 6px 0; }
details.grupo { margin-bottom: 12px; padding: 0; overflow: hidden; }
details.grupo > summary { list-style: none; display: flex; gap: 14px; align-items: center; padding: 14px 18px; cursor: pointer; flex-wrap: wrap; }
details.grupo > summary::-webkit-details-marker { display: none; }
details.grupo > summary::before { content: "▸"; color: var(--muted); }
details.grupo[open] > summary::before { content: "▾"; }
details.grupo > summary a { margin-left: auto; }
.grupo-body { padding: 0 18px 8px; border-top: 1px solid var(--border); }
.guias-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.guia-cli { border-left: 4px solid #e05252; }
table.mini td { padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 14px; }

/* quadro (callout) no estilo de aviso destacado */
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; }
.callout p { margin: 4px 0 0; }
.callout.info { background: #eef4ff; border-color: #c9dafb; color: #1d2b4a; }
.callout.ok { background: #e9f7ef; border-color: #bfe3cc; color: #14402a; }
.callout.danger { background: #fdecec; border-color: #f3c7c7; color: #5c1a1a; }
.callout-ico { font-size: 22px; line-height: 1; }
.callout-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.callout-grid > div { background: rgba(255,255,255,.7); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.callout-grid span { font-size: 12.5px; color: #4b5563; }
.callout-grid b { font-size: 19px; }
.callout-grid small { font-size: 12px; color: #4b5563; }
@media (max-width: 640px) { .callout-grid { grid-template-columns: 1fr; } }

.lista-nomes { columns: 2; margin: 0; padding-left: 18px; } .lista-nomes li { margin: 3px 0; }
@media (max-width: 640px) { .lista-nomes { columns: 1; } }

.msg-receita { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.msg-receita iframe { width: 100%; height: 420px; border: 1px solid var(--border); border-radius: 8px; margin-top: 8px; background: #fff; }

.graf-legenda { display: flex; gap: 16px; justify-content: center; color: #4b5563; margin-top: 2px; }
.graf-legenda span { display: inline-flex; align-items: center; gap: 6px; }
.graf-legenda i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
.graf-legenda i.lin { height: 3px; background: #7c3aed; border-radius: 2px; }
.graf-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.graf-resumo > div { background: #f5f3ff; border: 1px solid #e9e3ff; border-radius: 10px; padding: 10px 12px; }
.graf-resumo .lbl { display: block; font-size: 12px; color: #6b7280; }
.graf-resumo b { font-size: 18px; color: #4c1d95; }


/* =====================================================================
   Visual 2.0 — inspirado na Acessórias: navy profundo + dourado, movimento
   ===================================================================== */
:root {
  --gold: #c9a24a;
  --gold-2: #e6c77a;
  --navy-3: #16314f;
  --shadow: 0 1px 2px rgba(13, 27, 42, .05), 0 8px 24px rgba(13, 27, 42, .06);
  --shadow-hover: 0 2px 4px rgba(13, 27, 42, .06), 0 16px 36px rgba(13, 27, 42, .12);
  --radius: 16px;
}
body { background: radial-gradient(1200px 500px at 100% -10%, #e9eefb 0%, transparent 60%), #f3f5fa; }

/* menu lateral */
.side { background: linear-gradient(180deg, #0d1b2a 0%, #10243a 55%, #0b1724 100%); box-shadow: 4px 0 24px rgba(8, 18, 29, .18); }
.side .brand small { color: var(--gold-2) !important; letter-spacing: .18em; }
.nav a { position: relative; transition: background .2s, color .2s, transform .2s; }
.nav a:hover { transform: translateX(3px); }
.nav a.active { background: linear-gradient(90deg, rgba(201,162,74,.22), rgba(255,255,255,.06)); }
.nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--gold-2), var(--gold)); }
.nav a.active svg { color: var(--gold-2); }
.nav a .badge { background: linear-gradient(135deg, var(--gold-2), var(--gold)); color: #2b1d00; }

/* barra do topo */
.topbar { background: rgba(255,255,255,.78); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); position: sticky; top: 0; z-index: 20; }
.topbar h1 { font-weight: 700; letter-spacing: -.01em; }
.topbar h1::after { content: ""; display: block; width: 28px; height: 3px; border-radius: 3px; background: var(--gold); margin-top: 4px; }

/* cartões com movimento */
.card { border-color: #e6e9f2; transition: box-shadow .25s, transform .25s; animation: sobe .45s cubic-bezier(.2,.7,.2,1) both; }
.card:hover { box-shadow: var(--shadow-hover); }
.content > *:nth-child(2) { animation-delay: .05s; } .content > *:nth-child(3) { animation-delay: .1s; } .content > *:nth-child(4) { animation-delay: .15s; }
@keyframes sobe { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card h2 { font-weight: 700; letter-spacing: -.01em; }

/* botões */
.btn { transition: transform .15s, box-shadow .2s, background .2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #22a05a, #1a7f45); border: 0; box-shadow: 0 6px 16px rgba(31,138,76,.28); }
.btn.primary:hover { background: linear-gradient(135deg, #1f9452, #166b3a); }
.btn.navy { background: linear-gradient(135deg, var(--navy-3), var(--navy)); border: 0; }
.tabs { background: #e9ecf4; border-radius: 12px; }
.tabs button { transition: background .2s, color .2s; }
.tabs button.on { box-shadow: 0 4px 12px rgba(13,27,42,.1); }

/* ícones de arquivos e datas arredondados */
.file .ico { border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(201,54,54,.15); }
.file { transition: background .2s; border-radius: 10px; }
.file:hover { background: #f8f9fd; }
.event .date { background: linear-gradient(160deg, #eef3fb, #e1e9f6); border-radius: 12px; }
.cal .day { transition: background .15s, transform .15s; }
.cal .day:hover { transform: scale(1.06); }
.cal .day.sel { background: linear-gradient(135deg, var(--navy-3), var(--navy)); box-shadow: 0 6px 14px rgba(13,27,42,.25); }
.cal .day.today { border-color: var(--gold); border-width: 2px; }

/* números da gerência de envios */
.stat { transition: transform .2s, box-shadow .2s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

/* boas-vindas do cliente */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 30px 32px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(120deg, #0d1b2a 0%, #16314f 55%, #24476e 100%); box-shadow: 0 18px 40px rgba(13,27,42,.22); animation: sobe .5s both; }
.hero-txt { position: relative; z-index: 1; max-width: 640px; }
.hero-tag { display: inline-block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); border: 1px solid rgba(230,199,122,.45); border-radius: 99px; padding: 4px 12px; }
.hero h2 { font-size: clamp(24px, 3vw, 34px); margin: 14px 0 4px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 0 0 18px; opacity: .8; }
.hero-btn { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25); color: #fff; backdrop-filter: blur(6px); }
.hero-btn:hover { background: rgba(255,255,255,.18) !important; }
.hero-orbs i { position: absolute; border-radius: 50%; filter: blur(2px); animation: flutua 9s ease-in-out infinite; }
.hero-orbs i:nth-child(1) { width: 220px; height: 220px; right: -40px; top: -60px; background: radial-gradient(circle at 30% 30%, rgba(230,199,122,.55), rgba(201,162,74,0) 70%); }
.hero-orbs i:nth-child(2) { width: 160px; height: 160px; right: 160px; bottom: -70px; background: radial-gradient(circle at 30% 30%, rgba(79,141,247,.5), rgba(37,99,235,0) 70%); animation-delay: -3s; }
.hero-orbs i:nth-child(3) { width: 90px; height: 90px; right: 90px; top: 40px; background: radial-gradient(circle at 30% 30%, rgba(52,195,160,.5), rgba(14,138,106,0) 70%); animation-delay: -6s; }
@keyframes flutua { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-14px, 12px); } }

.atalhos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.atalho { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid #e6e9f2; text-decoration: none; color: inherit;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s, border-color .2s; animation: sobe .5s both; }
.atalho:nth-child(2) { animation-delay: .06s; } .atalho:nth-child(3) { animation-delay: .12s; } .atalho:nth-child(4) { animation-delay: .18s; }
.atalho:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--c) 40%, #e6e9f2); }
.at-ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, #fff); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 6%, transparent); transition: transform .3s; }
.atalho:hover .at-ico { transform: rotate(-8deg) scale(1.08); }
.at-ico svg { width: 22px; height: 22px; }
.at-txt b { display: block; font-size: 14.5px; }
.at-txt small { color: var(--muted); font-size: 12.5px; }
.at-badge { position: absolute; top: 10px; right: 12px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; border-radius: 99px; padding: 1px 8px; animation: pulsa 1.8s infinite; }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
@media (max-width: 1200px) { .atalhos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-2 > *, .stack > * { min-width: 0; }
@media (max-width: 520px) { .hero { padding: 22px 18px; } .atalhos { grid-template-columns: 1fr; } }

/* login */
.login-side { background: linear-gradient(130deg, #0d1b2a 0%, #16314f 50%, #24476e 100%); background-size: 200% 200%; animation: degrade 14s ease infinite; }
.login-side::after { content: ""; position: absolute; width: 420px; height: 420px; right: -120px; bottom: -140px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(230,199,122,.45), rgba(201,162,74,0) 70%); animation: flutua 10s ease-in-out infinite; }
.login-side li::before { color: var(--gold-2); }
@keyframes degrade { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }


/* ---------- Solicitação em visual de conversa (WhatsApp) ---------- */
.wa { display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 480px; border-radius: 18px; overflow: hidden; border: 1px solid #e3e6ee; box-shadow: var(--shadow); background: #fff; animation: sobe .4s both; }
.wa-topo { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: #f0f2f5; border-bottom: 1px solid #e3e6ee; }
.wa-voltar { color: #54656f; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; }
.wa-voltar:hover { background: #e2e5e9; }
.wa-voltar svg { width: 22px; height: 22px; }
.wa-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 700; color: #fff; background: linear-gradient(135deg, #16314f, #0d1b2a); box-shadow: inset 0 0 0 2px var(--gold); font-size: 14px; }
.wa-titulo { flex: 1; min-width: 0; line-height: 1.25; }
.wa-titulo b { display: block; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-titulo small { color: #667781; font-size: 12.5px; }
.wa-fundo { flex: 1; overflow-y: auto; padding: 18px 6%; display: flex; flex-direction: column; gap: 3px;
  background-color: #efeae2;
  background-image: radial-gradient(rgba(13,27,42,.05) 1.2px, transparent 1.3px), radial-gradient(rgba(201,162,74,.08) 1.2px, transparent 1.3px);
  background-size: 22px 22px, 22px 22px; background-position: 0 0, 11px 11px; }
.wa-dia { text-align: center; margin: 10px 0 6px; }
.wa-dia span { display: inline-block; background: #fff; color: #54656f; font-size: 12px; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-linha { display: flex; margin-top: 4px; }
.wa-linha.eu { justify-content: flex-end; }
.wa-bolha { position: relative; max-width: min(72%, 560px); background: #fff; padding: 7px 10px 8px; border-radius: 0 10px 10px 10px; box-shadow: 0 1px .5px rgba(11,20,26,.13); animation: bolha .25s ease-out both; }
.wa-linha.eu .wa-bolha { background: #d9fdd3; border-radius: 10px 0 10px 10px; }
.wa-bolha::before { content: ""; position: absolute; top: 0; left: -8px; border: 8px solid transparent; border-top-color: #fff; border-right-color: #fff; border-width: 0 8px 10px 0; }
.wa-linha.eu .wa-bolha::before { left: auto; right: -8px; border-color: transparent; border-top-color: #d9fdd3; border-left-color: #d9fdd3; border-width: 0 0 10px 8px; }
@keyframes bolha { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.wa-quem { font-size: 12.5px; font-weight: 700; color: #0e7a5f; margin-bottom: 2px; }
.wa-txt { white-space: pre-wrap; word-wrap: break-word; font-size: 14.5px; color: #111b21; padding-right: 64px; }
.wa-hora { position: absolute; right: 9px; bottom: 5px; font-size: 11px; color: #667781; }
.wa-check { font-style: normal; color: #53bdeb; letter-spacing: -3px; margin-left: 2px; }
.wa-doc { display: flex; align-items: center; gap: 10px; width: 100%; min-width: 230px; background: rgba(11,20,26,.05); border: 0; border-radius: 8px; padding: 9px 10px; margin: 2px 0 6px; cursor: pointer; text-align: left; }
.wa-doc:hover { background: rgba(11,20,26,.09); }
.wa-doc-ico { width: 36px; height: 40px; border-radius: 5px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.wa-doc-txt { flex: 1; min-width: 0; }
.wa-doc-txt b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-doc-txt small { color: #667781; }
.wa-doc svg { width: 18px; height: 18px; color: #54656f; flex: none; }
.wa-bolha:has(.wa-doc):not(:has(.wa-txt)) { padding-bottom: 22px; }
.wa-rodape { background: #f0f2f5; padding: 8px 14px 10px; border-top: 1px solid #e3e6ee; }
.wa-canais { font-size: 13px; margin-bottom: 6px; }
.wa-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wa-chips:not(:empty) { margin-bottom: 6px; }
.wa-barra { display: flex; align-items: flex-end; gap: 8px; }
.wa-clip { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #54656f; cursor: pointer; flex: none; transition: background .2s, transform .2s; }
.wa-clip:hover { background: #e2e5e9; transform: rotate(-12deg); }
.wa-clip svg { width: 22px; height: 22px; }
.wa-barra textarea { flex: 1; resize: none; border: 0; border-radius: 22px; padding: 11px 16px; font-size: 15px; line-height: 1.35; background: #fff; max-height: 140px; outline: none; box-shadow: 0 1px .5px rgba(11,20,26,.08); }
.wa-enviar { width: 44px; height: 44px; border-radius: 50%; border: 0; flex: none; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #25d366, #1aa851); box-shadow: 0 4px 12px rgba(37,211,102,.35); transition: transform .15s; }
.wa-enviar:hover { transform: scale(1.07); }
.wa-enviar:disabled { opacity: .6; }
.wa-enviar svg { width: 20px; height: 20px; margin-left: -2px; }
@media (max-width: 720px) {
  .wa { height: calc(100vh - 96px); border-radius: 0; margin: -24px -16px 0; }
  .wa-fundo { padding: 14px 10px; }
  .wa-bolha { max-width: 86%; }
  .wa-topo .pill { display: none; }
}

.wa-avatar img { width: 56%; height: 56%; object-fit: contain; }

.pd-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
.pd-previa { border-radius: 14px; min-height: 260px; padding: 18px 14px; }
.pd-previa .wa-bolha { max-width: 95%; }
@media (max-width: 900px) { .pd-grid { grid-template-columns: 1fr; } }

.envia-cli { margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(135deg, #ecfdf3, #f6fffa); border: 1px solid #c9eed8; }
tr.muted td { color: var(--muted); }

.eg-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 16px; margin-top: 10px; padding: 12px; background: #f8f9fc; border-radius: 10px; }

.cli-lista { margin-top: 8px; padding: 12px; background: #f8f9fc; border: 1px solid var(--border); border-radius: 12px; }
.cli-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 6px 16px; max-height: 280px; overflow: auto; }
.cli-grade label[hidden] { display: none; }

/* estimativa (azul) x oficial do PGDAS (verde) */
.aliq-est { background: #eef4ff; border: 1px solid #c7dafc; border-radius: 10px; padding: 12px 14px; margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.aliq-est .lbl { color: #1d4fb8; }
.aliq-est .num { color: #1d4fb8; }
.aliq-est .sep { border-top-color: #c7dafc; }
.aliq-box > .sep { display: none; }

.est-cards { display: grid; gap: 8px; margin-top: 4px; }
.est-card { background: #fff; border: 1px solid #c7dafc; border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; }
.est-card span { font-size: 12.5px; color: #4b5d80; }
.est-card b { font-size: 21px; color: #1d4fb8; line-height: 1.2; }
.est-card.forte { background: linear-gradient(135deg, #2563eb, #1d4fb8); border-color: #1d4fb8; box-shadow: 0 6px 14px rgba(37,99,235,.28); }
.est-card.forte span { color: #dbe7ff; }
.est-card.forte b { color: #fff; font-size: 24px; }

.rt-destaque { background: linear-gradient(135deg, #0d1b2a, #16314f); color: #fff; border-radius: 14px; padding: 16px 20px; display: grid; gap: 4px; }
.rt-destaque b { font-size: 22px; color: var(--gold-2); }
.rt-destaque span { opacity: .9; }
td.rt-menor { background: #e8f7ee; font-weight: 700; color: #0e7a5e; }
@media print { .side, .topbar, .tabs, #rtVoltar, #rtImprimir { display: none !important; } .shell { display: block; } }

.rt-expl { background: #fafbfe; border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; }
.rt-resumo { background: #e8f7ee; border: 1px solid #bfe6cf; color: #0b5d43; border-radius: 10px; padding: 12px 14px; font-weight: 600; margin-bottom: 8px; }
.rt-expl h4 { margin: 14px 0 4px; color: #0d1b2a; }
.rt-expl p, .rt-expl li { margin: 4px 0; line-height: 1.55; }
.rt-expl ul { margin: 4px 0 0; padding-left: 20px; }

.mem-top { display: flex; gap: 24px; flex-wrap: wrap; }
.mem-top > div { flex: 1; min-width: 150px; display: flex; flex-direction: column; }
.mem-top .lbl { font-weight: 700; color: #3a4565; }
.mem-top b { font-weight: 500; font-size: 15px; }

/* ---- Reforma: cartões e gráfico modernos ---- */
.rt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin: 18px 0 8px; }
.rt-kpi { position: relative; background: #fff; border: 1px solid #e6e9f2; border-radius: 16px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; animation: sobe .5s both; }
.rt-kpi::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: linear-gradient(90deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); }
.rt-kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.rt-kpi.top { background: linear-gradient(160deg, color-mix(in srgb, var(--c) 9%, #fff), #fff); border-color: color-mix(in srgb, var(--c) 45%, #fff); }
.rt-kpi-n { font-size: 12.5px; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, #1f2433); text-transform: uppercase; letter-spacing: .03em; margin-top: 4px; }
.rt-kpi b { font-size: 27px; line-height: 1.15; color: #1f2433; }
.rt-kpi b small { font-size: 13px; font-weight: 500; color: var(--muted); }
.rt-kpi-p { font-size: 12.5px; color: var(--muted); }
.rt-kpi-d { font-size: 12.5px; font-weight: 700; margin-top: 2px; color: #6b7280; }
.rt-kpi-d.up { color: #e11d48; } .rt-kpi-d.down { color: #059669; }
.rt-badge { position: absolute; top: 12px; right: 12px; background: var(--c); color: #fff; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; letter-spacing: .02em; }
.rt-chart { position: relative; background: #fff; border: 1px solid #e6e9f2; border-radius: 16px; padding: 14px 16px 10px; margin-top: 10px; box-shadow: var(--shadow); }
.rt-chart-t { font-weight: 700; margin: 0 0 4px 4px; }
.rt-chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.rt-linha { stroke-dasharray: 1; stroke-dashoffset: 1; animation: rtDesenha 1.3s cubic-bezier(.3,.7,.2,1) forwards; filter: drop-shadow(0 4px 6px rgba(13,27,42,.12)); }
.rt-area { opacity: 0; animation: rtFade .9s ease forwards; }
.rt-ponto { opacity: 0; animation: rtFade .4s ease 1s forwards; transition: r .15s; cursor: pointer; }
.rt-ponto.on { r: 7.5; }
@keyframes rtDesenha { to { stroke-dashoffset: 0; } }
@keyframes rtFade { to { opacity: 1; } }
.rt-tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(13,27,42,.95); color: #fff; border-radius: 12px; padding: 10px 12px; min-width: 230px; box-shadow: 0 12px 28px rgba(0,0,0,.28); font-size: 12.5px; }
.rt-tip .muted { color: #b8c3da; }
.rt-tip-l { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.rt-tip-l i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.rt-tip-l span { flex: 1; color: #dbe3ef; }
.rt-tip-l em { font-style: normal; font-size: 10px; font-weight: 700; background: #10b981; color: #fff; border-radius: 99px; padding: 1px 7px; }
@media (prefers-reduced-motion: reduce) { .rt-linha, .rt-area, .rt-ponto { animation: none !important; opacity: 1; stroke-dashoffset: 0; } }
.rt-badge { position: static !important; align-self: flex-start; margin: 2px 0 2px; }
.rt-kpi { min-height: 150px; }
