:root {
  --bg: #f1f6fd;
  --surface: #ffffff;
  --surface-2: #e8f0fd;
  --surface-3: #d9e6fa;
  --ink: #0b1b3f;
  --ink-muted: #475a82;
  --ink-faint: #6f82a8;
  --border: #d7e2f4;
  --border-strong: #b9c9e6;
  --accent: #1b57f0;
  --accent-strong: #1342bd;
  --accent-soft: #e3ecff;
  --accent-ink: #ffffff;
  --navy: #0a1c46;
  --navy-2: #12295f;
  --navy-ink: #c3d0ee;
  --warn: #b4650b;
  --warn-soft: #fbeedc;
  --critical: #c33b2e;
  --critical-soft: #fbeae7;
  --success: #1e8a5b;
  --success-soft: #e3f5ec;
  --info: #1b57f0;
  --sans: "Figtree", system-ui, -apple-system, sans-serif;
  --disp: "Figtree", system-ui, -apple-system, sans-serif;
  --mono: "Figtree", system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(11, 27, 63, 0.06);
  --shadow-md: 0 4px 16px -4px rgba(11, 27, 63, 0.14);
  --shadow-lg: 0 16px 48px -12px rgba(11, 27, 63, 0.26);
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #081230;
    --surface: #0f1c42;
    --surface-2: #152654;
    --surface-3: #1e3269;
    --ink: #e8eefc;
    --ink-muted: #a3b3d8;
    --ink-faint: #7488b3;
    --border: #223467;
    --border-strong: #334a85;
    --accent: #5f8bff;
    --accent-strong: #90b0ff;
    --accent-soft: #172b63;
    --accent-ink: #06122f;
    --warn: #e5a542;
    --warn-soft: #2e2410;
    --critical: #e8776a;
    --critical-soft: #341714;
    --success: #4fc98a;
    --success-soft: #103324;
    --info: #5f8bff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  --bg: #081230;
  --surface: #0f1c42;
  --surface-2: #152654;
  --surface-3: #1e3269;
  --ink: #e8eefc;
  --ink-muted: #a3b3d8;
  --ink-faint: #7488b3;
  --border: #223467;
  --border-strong: #334a85;
  --accent: #5f8bff;
  --accent-strong: #90b0ff;
  --accent-soft: #172b63;
  --accent-ink: #06122f;
  --warn: #e5a542;
  --warn-soft: #2e2410;
  --critical: #e8776a;
  --critical-soft: #341714;
  --success: #4fc98a;
  --success-soft: #103324;
  --info: #5f8bff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px -12px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4 {
  font-family: var(--disp);
  font-weight: 700;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}
code,
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
button {
  font-family: var(--sans);
}
::selection {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input,
select,
textarea {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-muted);
  display: block;
  margin-bottom: 5px;
}
.fld {
  margin-bottom: 14px;
}
.fld-hint {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 4px;
}
[hidden] {
  display: none !important;
}

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13.5px;
  border-radius: 9px;
  padding: 9px 15px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--border-strong);
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-3);
}
.btn.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}
.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
}
.btn.ghost:hover {
  background: var(--surface-2);
}
.btn.danger {
  color: var(--critical);
}
.btn.sm {
  padding: 6px 10px;
  font-size: 12.5px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: 236px 1fr;
  min-height: 100vh;
}
@media (max-width: 880px) {
  .app {
    grid-template-columns: 1fr;
  }
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
@media (max-width: 880px) {
  .sidebar {
    position: fixed;
    inset: 0 22% 0 0;
    z-index: 40;
    height: 100dvh;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 18px;
}
.brand .mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--disp);
  font-weight: 800;
  font-size: 15px;
  flex: none;
}
.brand .name {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 16.5px;
  letter-spacing: -0.01em;
}
.brand .name small {
  display: block;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-faint);
}

.navgroup {
  margin-top: 14px;
}
.navgroup:first-of-type {
  margin-top: 0;
}
.navgroup .glabel {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 10px 6px;
}
.navitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
}
.navitem .ic {
  width: 17px;
  display: inline-flex;
  justify-content: center;
  flex: none;
}
.navitem:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.navitem.active {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.navitem .badge {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--surface-3);
  color: var(--ink-muted);
  padding: 1px 6px;
  border-radius: 100px;
}
.navitem.active .badge {
  background: var(--accent);
  color: var(--accent-ink);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 28, 0.4);
  z-index: 35;
  display: none;
}
.scrim.show {
  display: block;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.hamburger {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}
@media (max-width: 880px) {
  .hamburger {
    display: flex;
  }
}
.search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 8px 12px;
  color: var(--ink-faint);
  font-size: 13.5px;
}
.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  font-family: var(--disp);
}
.theme-toggle {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.content {
  padding: 26px 28px 90px;
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
}
.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.view-head h1 {
  font-size: 23px;
  letter-spacing: -0.01em;
}
.view-head .sub {
  color: var(--ink-muted);
  font-size: 14px;
  margin-top: 5px;
  max-width: 62ch;
}
.view-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumbs {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-bottom: 8px;
}

/* ---------- Cards / stats ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.pad {
  padding: 20px;
}
.grid {
  display: grid;
  gap: 14px;
}
.g2 {
  grid-template-columns: repeat(2, 1fr);
}
.g3 {
  grid-template-columns: repeat(3, 1fr);
}
.g4 {
  grid-template-columns: repeat(4, 1fr);
}
.g5 {
  grid-template-columns: repeat(5, 1fr);
}
.g6 {
  grid-template-columns: repeat(6, 1fr);
}
@media (max-width: 900px) {
  .g3,
  .g4,
  .g5,
  .g6 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 560px) {
  .g2,
  .g3,
  .g4,
  .g5,
  .g6 {
    grid-template-columns: 1fr;
  }
}

.stat {
  padding: 16px 18px;
}
.stat .k {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}
.stat .v {
  font-family: var(--disp);
  font-size: 23px;
  font-weight: 800;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.stat .d {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 3px;
}
.stat.accent .v {
  color: var(--accent-strong);
}
.stat.warn .v {
  color: var(--warn);
}
.stat.critical .v {
  color: var(--critical);
}

/* ---------- Section blocks ---------- */
.block {
  margin-bottom: 26px;
}
.block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.block-title h3 {
  font-size: 15.5px;
}
.block-title .hint {
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data th {
  text-align: left;
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
table.data td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:hover {
  background: var(--surface-2);
}
table.data tbody tr:last-child td {
  border-bottom: none;
}
.cell-strong {
  font-weight: 600;
  color: var(--ink);
}
.cell-sub {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  font-family: var(--sans);
}
.pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.neutral {
  background: var(--surface-3);
  color: var(--ink-muted);
}
.pill.accent {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.pill.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.pill.critical {
  background: var(--critical-soft);
  color: var(--critical);
}
.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

/* ---------- Filters bar ---------- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.filters select,
.filters input {
  width: auto;
  min-width: 150px;
}
.filters input[type="search"] {
  min-width: 220px;
}

/* ---------- Wizard ---------- */
.stepper {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.step-chip {
  font-family: var(--mono);
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 6px;
}
.step-chip.done {
  color: var(--success);
  border-color: transparent;
  background: var(--success-soft);
}
.step-chip.current {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  font-weight: 600;
}
.wizard-panel {
  display: none;
}
.wizard-panel.active {
  display: block;
}
.wizard-panel.enter {
  animation: rise var(--dur) var(--ease-out);
}
.step-progress {
  height: 3px;
  background: var(--surface-3);
  border-radius: 3px;
  margin: -14px 0 22px;
  overflow: hidden;
}
.step-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
  transition: width var(--dur-slow) var(--ease-out);
}
.step-chip {
  transition:
    background-color var(--dur-fast),
    color var(--dur-fast),
    border-color var(--dur-fast);
}
.wizard-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
}

.eq-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 16px;
  margin-bottom: 12px;
  background: var(--surface-2);
}
.eq-card .eq-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.eq-card .eq-head .t {
  font-weight: 700;
  font-size: 13.5px;
}
.choice-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.choice {
  flex: 1;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  font-weight: 600;
  font-size: 13px;
}
.choice.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.calc-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 18px;
}
.calc-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-strong);
  font-size: 13.5px;
}
.calc-row:last-child {
  border-bottom: none;
}
.calc-row .l {
  color: var(--ink-muted);
}
.calc-row .r {
  font-family: var(--mono);
  font-weight: 600;
}
.calc-hero {
  text-align: center;
  padding: 22px 0;
}
.calc-hero .lbl {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
}
.calc-hero .val {
  font-family: var(--disp);
  font-size: 38px;
  font-weight: 800;
  color: var(--accent-strong);
  margin: 6px 0;
}
.calc-hero .range {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-muted);
}

/* ---------- Kanban ---------- */
.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 11px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

/* ---------- OS pipeline ---------- */
.os-track {
  display: flex;
  gap: 4px;
  margin: 4px 0 20px;
  flex-wrap: wrap;
}
.os-stage {
  font-family: var(--mono);
  font-size: 11px;
  padding: 6px 11px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-faint);
  border: 1px solid var(--border);
}
.os-stage.on {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ---------- Modal ---------- */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 28, 0.45);
  z-index: 60;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 5vh 16px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.modal-scrim.show {
  display: flex;
}
.modal-scrim.in {
  opacity: 1;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out);
}
.modal-scrim.in .modal {
  opacity: 1;
  transform: none;
}
.modal-scrim:not(.in) .modal {
  transition-duration: var(--dur-fast);
}
.modal.lg {
  max-width: 820px;
}
.modal-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h3 {
  font-size: 16px;
}
.modal-body {
  padding: 20px 22px;
  max-height: 62vh;
  overflow-y: auto;
}
.modal-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 18px;
  line-height: 1;
}

/* ---------- Fatura (visualização / impressão) ---------- */
.banner.prov {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid var(--warn);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.invoice-doc {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  background: var(--surface);
}
.invoice-doc .inv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.invoice-doc .inv-brand {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 18px;
}
.invoice-doc .inv-brand .sub {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.invoice-doc .inv-num {
  text-align: right;
}
.invoice-doc .inv-num .num {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}
.invoice-doc .inv-num .comp {
  font-size: 12px;
  color: var(--ink-faint);
}
.invoice-doc .inv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}
.invoice-doc .inv-block .lbl {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.invoice-doc .inv-block .v {
  font-size: 13.5px;
}
.invoice-doc table.inv-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 16px;
}
.invoice-doc table.inv-items th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
}
.invoice-doc table.inv-items td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
}
.invoice-doc table.inv-items td.num,
.invoice-doc table.inv-items th.num {
  text-align: right;
  font-family: var(--mono);
}
.invoice-doc .inv-totals {
  margin-left: auto;
  width: 280px;
}
.invoice-doc .inv-totals .row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
}
.invoice-doc .inv-totals .row.total {
  border-top: 2px solid var(--ink);
  margin-top: 6px;
  padding-top: 10px;
  font-weight: 700;
  font-size: 16px;
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastin var(--dur) var(--ease-out);
  transition:
    opacity var(--dur-fast) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.toast.out {
  opacity: 0;
  transform: translateY(4px);
}
@keyframes toastin {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-faint);
}
.empty .ic {
  font-size: 26px;
  margin-bottom: 10px;
}

.banner {
  border-radius: 11px;
  padding: 14px 16px;
  font-size: 13.5px;
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.banner.info {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.banner.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.banner.crit {
  background: var(--critical-soft, #fde8e8);
  color: var(--critical);
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.tab {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-muted);
  border: 1px solid transparent;
}
.tab:hover {
  background: var(--surface-2);
}
.tab.active {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Painel inicial ---------- */
.hero {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #fff;
  border-radius: 18px;
  padding: 24px 26px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.hero h1 {
  color: #fff;
  font-size: 24px;
}
.hero .sub {
  color: rgba(255, 255, 255, 0.82);
  margin-top: 4px;
  font-size: 13.5px;
}
.hero .date-pill {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 100px;
  padding: 3px 11px;
  font-size: 12px;
  margin-left: 8px;
  vertical-align: middle;
  font-weight: 600;
}
.hero .btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}
.hero .btn:hover {
  background: rgba(255, 255, 255, 0.24);
}
.hero-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}
@media (max-width: 900px) {
  .hero-kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
.hero-kpi {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 14px 16px;
}
.hero-kpi .k {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}
.hero-kpi .v {
  font-family: var(--disp);
  font-size: 26px;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.hero-kpi .d {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}

.kcard {
  padding: 18px;
}
.kcard-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.kicon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.kicon.blue {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.kicon.green {
  background: var(--success-soft);
  color: var(--success);
}
.kicon.amber {
  background: var(--warn-soft);
  color: var(--warn);
}
.kicon.red {
  background: var(--critical-soft);
  color: var(--critical);
}
.kcard .v {
  font-family: var(--disp);
  font-size: 26px;
  font-weight: 800;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.kcard .k {
  font-size: 13px;
  color: var(--ink-muted);
}
.meter {
  margin-top: 12px;
}
.meter-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 5px;
}
.bar {
  height: 6px;
  border-radius: 6px;
  background: var(--surface-3);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: var(--accent);
  transition: width var(--dur-slow) var(--ease-out);
}
.bar > i.green {
  background: var(--success);
}
.bar > i.amber {
  background: var(--warn);
}
.bar > i.red {
  background: var(--critical);
}
.kcard .foot {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 8px;
}

.rev-row {
  margin-bottom: 16px;
}
.rev-row .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  margin-bottom: 6px;
  gap: 8px;
}
.rev-row .top b {
  font-weight: 700;
}
.rev-row .top .meta {
  color: var(--ink-faint);
  font-size: 12px;
  margin-left: 6px;
}
.bar.lg {
  height: 30px;
  border-radius: 9px;
}
.bar.lg > i {
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.mini-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
@media (max-width: 700px) {
  .mini-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}
.mini-tile {
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}
.mini-tile .v {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.mini-tile .l {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}
.mini-tile.blue {
  background: var(--accent-soft);
}
.mini-tile.green {
  background: var(--success-soft);
}
.mini-tile.amber {
  background: var(--warn-soft);
}
.mini-tile.red {
  background: var(--critical-soft);
}

.feed-item {
  display: flex;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.feed-item:last-child {
  border-bottom: 0;
}
.feed-item .kicon {
  width: 32px;
  height: 32px;
  font-size: 14px;
  flex: none;
}
.feed-item .t {
  color: var(--ink);
}
.feed-item .w {
  color: var(--ink-faint);
  font-size: 12px;
  margin-top: 2px;
}

.qa {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.qa button {
  border: 0;
  cursor: pointer;
  text-align: left;
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  font: inherit;
  transition:
    transform 120ms var(--ease-out),
    filter 120ms;
}
.qa button:hover {
  filter: brightness(1.06);
}
.qa button:active {
  transform: scale(0.98);
}
.qa b {
  display: block;
  font-size: 14px;
  margin-top: 8px;
}
.qa span {
  font-size: 12px;
  opacity: 0.85;
}
.qa .q1 {
  background: linear-gradient(135deg, #1d3eb8, #2954e5);
}
.qa .q2 {
  background: linear-gradient(135deg, #0b8f63, #1e8a5b);
}
.qa .q3 {
  background: linear-gradient(135deg, #d9730d, #f08a24);
}
.qa .q4 {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}

.rank {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  margin-bottom: 10px;
}
.rank .badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  flex: none;
  position: relative;
}
.rank .badge i {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  font-style: normal;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rank .nm {
  font-weight: 700;
  font-size: 13.5px;
}
.rank .sb {
  font-size: 12px;
  color: var(--ink-faint);
}
.rank .val {
  margin-left: auto;
  text-align: right;
  font-weight: 800;
  font-family: var(--disp);
}
.rank .val small {
  display: block;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--ink-faint);
  font-size: 11.5px;
}

.pend {
  border-radius: 16px;
  padding: 18px;
  border: 1px solid transparent;
}
.pend.amber {
  background: var(--warn-soft);
  border-color: var(--warn);
}
.pend.blue {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.pend.red {
  background: var(--critical-soft);
  border-color: var(--critical);
}
.pend .top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pend .n {
  font-family: var(--disp);
  font-weight: 800;
  font-size: 20px;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 100px;
  background: currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pend .n span {
  color: #fff;
}
.pend.amber {
  color: var(--warn);
}
.pend.blue {
  color: var(--accent-strong);
}
.pend.red {
  color: var(--critical);
}
.pend h4 {
  color: var(--ink);
  font-size: 15px;
  margin: 12px 0 4px;
}
.pend p {
  color: var(--ink-muted);
  font-size: 12.5px;
  margin: 0 0 14px;
}
.pend .btn {
  width: 100%;
  justify-content: center;
  background: currentColor;
  border-color: transparent;
}
.pend .btn span {
  color: #fff;
}

/* ---------- Movimento (Motion Principles) ----------
     Curto (100–300 ms), ease-out, sem bounce em ações utilitárias, sem scale(0),
     anima só transform/opacity e respeita "reduzir movimento". */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 140ms;
  --dur: 200ms;
  --dur-slow: 320ms;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn,
.navitem {
  transition:
    background-color var(--dur-fast),
    border-color var(--dur-fast),
    color var(--dur-fast),
    transform 100ms var(--ease-out);
}
.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.content {
  transition:
    opacity 90ms ease-out,
    transform 90ms ease-out;
}
.content.leaving {
  opacity: 0;
  transform: translateY(-4px);
}
.content.entering > * {
  animation: rise var(--dur) var(--ease-out) both;
}

/* barra de progresso no topo (navegação e chamadas à API) */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) ease-out;
}
.progress.on {
  opacity: 1;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}

/* skeleton: blocos neutros com brilho suave, sem pulsar */
.sk {
  position: relative;
  overflow: hidden;
  background: var(--surface-3);
  border-radius: 8px;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.3s infinite;
}
:root[data-theme="dark"] .sk::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.07), transparent);
}
.sk-wrap {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.sk-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.sk-title {
  height: 26px;
  width: min(260px, 60%);
}
.sk-sub {
  height: 12px;
  width: min(380px, 80%);
  margin-top: 10px;
}
.sk-btn {
  height: 36px;
  width: 128px;
  border-radius: 9px;
}
.sk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}
.sk-stat {
  height: 92px;
  border-radius: 14px;
}
.sk-panel {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sk-row {
  height: 14px;
}
.sk-row.w1 {
  width: 92%;
}
.sk-row.w2 {
  width: 78%;
}
.sk-row.w3 {
  width: 85%;
}
.sk-row.w4 {
  width: 64%;
}

/* sincronização (Printway) */
body.is-syncing [data-sync] {
  pointer-events: none;
  opacity: 0.65;
}
body.is-syncing [data-sync]::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

/* respeita "reduzir movimento" do sistema */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .sk::after {
    display: none;
  }
}

/* ============================================================
   COMPONENTES DO SISTEMA FUNCIONAL
   ============================================================ */
.btn.danger-solid {
  background: var(--critical);
  color: #fff;
  border-color: var(--critical);
}
.btn.danger-solid:hover {
  filter: brightness(1.08);
  background: var(--critical);
}
a.btn {
  text-decoration: none;
}
a {
  color: var(--accent-strong);
}
.cell-strong {
  text-decoration: none;
}
a.cell-strong:hover {
  text-decoration: underline;
}
.req {
  color: var(--critical);
}
.nota {
  font-size: 12px;
  color: var(--ink-muted);
}

.modal.sm {
  max-width: 420px;
}
.modal.xl {
  max-width: 980px;
}
.confirm-scrim {
  z-index: 70;
}
.docwrap {
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
}
.docframe {
  display: block;
  border: 0;
  background: #fff;
  transform-origin: 0 0;
}

.frm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 620px) {
  .frm-grid {
    grid-template-columns: 1fr;
  }
  .frm-grid > .fld {
    grid-column: 1 / -1 !important;
  }
}
.fld.err input,
.fld.err select,
.fld.err textarea {
  border-color: var(--critical);
  box-shadow: 0 0 0 3px var(--critical-soft);
}
.fld-err {
  color: var(--critical);
  font-size: 12px;
  margin-top: 4px;
  font-weight: 600;
}
label.chk {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  color: var(--ink);
  font-size: 13.5px;
  margin: 0;
  cursor: pointer;
}
label.chk input {
  width: auto;
}
.checks {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  max-height: 180px;
  overflow: auto;
}
.money {
  display: flex;
  align-items: stretch;
}
.money .pre {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-right: 0;
  border-radius: 9px 0 0 9px;
  color: var(--ink-muted);
  font-size: 13px;
}
.money input {
  border-radius: 0 9px 9px 0;
}
input[readonly] {
  background: var(--surface-2);
  color: var(--ink-muted);
}
.modal-foot {
  flex-wrap: wrap;
}

.sortable {
  cursor: pointer;
  user-select: none;
}
.sortable:hover {
  color: var(--ink);
}
.lst-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--ink-faint);
}
td.acoes {
  text-align: right;
  white-space: nowrap;
}
td.acoes .btn {
  margin-left: 4px;
}
.toast.erro {
  background: var(--critical);
  color: #fff;
}

.comp-sel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.comp-sel input {
  width: auto;
}
label.inl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 13px;
}
label.inl input {
  width: auto;
}
.in-leitura {
  width: 124px;
  text-align: right;
  font-family: var(--mono);
  padding: 7px 9px;
}

.barchart {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  height: 170px;
  align-items: end;
  margin: 6px 0 4px;
}
.bc-col {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-end;
}
.bc-bars {
  flex: 1;
  display: flex;
  gap: 4px;
  align-items: flex-end;
  border-bottom: 1px solid var(--border-strong);
}
.bc-bars i {
  flex: 1;
  min-height: 2px;
  border-radius: 5px 5px 0 0;
  transition: height var(--dur-slow) var(--ease-out);
}
i.in {
  background: var(--accent);
}
i.out {
  background: var(--critical);
}
i.out2 {
  background: var(--success);
}
.bc-l {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-faint);
  padding-top: 5px;
  font-family: var(--mono);
}
.legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 8px;
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
}
.dash2 {
  grid-template-columns: 2fr 1fr;
}
@media (max-width: 900px) {
  .dash2 {
    grid-template-columns: 1fr;
  }
}

.rel-link {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--ink);
  margin: 0 -6px 4px;
}
.rel-link:hover {
  background: var(--surface-2);
}
.rel-link b {
  display: block;
  font-size: 13.5px;
}
.rel-link span {
  font-size: 12px;
  color: var(--ink-muted);
}

.onb-step {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-2);
}
.onb-step .n {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex: none;
}
.onb-step.ok {
  opacity: 0.65;
}
.onb-step.ok .n {
  background: var(--success);
  color: #fff;
}
.onb-step b {
  font-size: 13.5px;
}

.sync {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 5px 10px;
  border-radius: 100px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-faint);
  white-space: nowrap;
  cursor: default;
}
.sync.salvo {
  color: var(--success);
}
.sync.salvando {
  color: var(--accent-strong);
}
.sync.erro {
  color: var(--critical);
  border-color: var(--critical);
  cursor: pointer;
}
.search {
  position: relative;
}
.search input {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none !important;
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
}
.gresults {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
  overflow: hidden;
}
.gresults.show {
  display: block;
}
.gr-item {
  display: flex;
  gap: 10px;
  padding: 9px 14px;
  text-decoration: none;
  color: var(--ink);
  align-items: center;
}
.gr-item:hover {
  background: var(--surface-2);
}
.gr-item .ic {
  width: 22px;
  text-align: center;
  color: var(--ink-faint);
}
.gr-item b {
  display: block;
  font-size: 13.5px;
}
.gr-item small {
  color: var(--ink-faint);
  font-size: 12px;
}
.gr-vazio {
  padding: 14px;
  color: var(--ink-faint);
  font-size: 13px;
}
.usermenu {
  position: absolute;
  right: 26px;
  top: 56px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 220px;
  display: none;
  z-index: 60;
}
.usermenu.show {
  display: block;
}
.usermenu .info {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.usermenu .info b {
  display: block;
}
.usermenu .info span {
  color: var(--ink-faint);
  font-size: 12px;
}
.usermenu a,
.usermenu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  border: 0;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}
.usermenu a:hover,
.usermenu button:hover {
  background: var(--surface-2);
}

.sel-card {
  cursor: pointer;
}
.sel-card.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.qa a {
  border: 0;
  cursor: pointer;
  text-align: left;
  color: #fff;
  border-radius: 14px;
  padding: 16px;
  font: inherit;
  text-decoration: none;
  display: block;
  transition:
    transform 120ms var(--ease-out),
    filter 120ms;
}
.qa a:hover {
  filter: brightness(1.06);
}
.qa a:active {
  transform: scale(0.98);
}
.qa a b {
  display: block;
  font-size: 14px;
  margin-top: 8px;
}
.qa a span {
  font-size: 12px;
  opacity: 0.85;
}
.qa a.q1 {
  background: linear-gradient(135deg, #1d3eb8, #2954e5);
}
.qa a.q2 {
  background: linear-gradient(135deg, #0b8f63, #1e8a5b);
}
.qa a.q3 {
  background: linear-gradient(135deg, #d9730d, #f08a24);
}
.qa a.q4 {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
}
a.rank,
a.feed-item {
  text-decoration: none;
  color: inherit;
}
a.feed-item:hover .t {
  text-decoration: underline;
}
.pend .btn {
  text-decoration: none;
}
.tab {
  cursor: pointer;
}
.empty a,
.empty .btn {
  text-decoration: none;
}

@media print {
  .sidebar,
  .topbar,
  .toast-wrap,
  .progress {
    display: none !important;
  }
}

/* ---------- CRM: funil (kanban) ---------- */
.kb {
  display: grid;
  grid-template-columns: repeat(4, minmax(215px, 1.15fr)) repeat(2, minmax(180px, 0.8fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.kb-col {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 10px;
  transition: background-color var(--dur-fast, 0.15s);
}
.kb-col.over {
  background: var(--accent-soft);
  outline: 2px dashed var(--accent);
}
.kb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  padding: 2px 2px 6px;
}
.kb-head .cnt {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  background: var(--surface);
  border-radius: 100px;
  padding: 1px 7px;
}
.kb-prob-l {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  margin-left: 6px;
}
.kb-sum {
  font-size: 11.5px;
  color: var(--ink-soft, var(--ink-faint));
  font-weight: 600;
  padding: 0 2px 8px;
}
.kb-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition:
    box-shadow var(--dur-fast, 0.15s),
    transform var(--dur-fast, 0.15s);
}
.kb-card:hover {
  box-shadow: var(--shadow-md, 0 4px 14px rgba(15, 22, 48, 0.1));
  transform: translateY(-1px);
}
.kb-card.drag {
  opacity: 0.45;
}
.kb-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.kb-t {
  font-weight: 650;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
}
.kb-t:hover {
  text-decoration: underline;
}
.kb-val {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent);
  white-space: nowrap;
}
.kb-m {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 3px;
}
.kb-next {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  font-size: 11.5px;
  margin-top: 8px;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-soft, var(--ink));
}
.kb-next b {
  font-weight: 650;
  white-space: nowrap;
}
.kb-next.late {
  background: var(--critical-soft, #fdecec);
  color: var(--critical);
}
.kb-next.today {
  background: var(--warn-soft, #fff4dc);
  color: var(--warn, #a15c00);
}
.kb-next.warn {
  background: var(--warn-soft, #fff4dc);
  color: var(--warn, #a15c00);
}
.kb-prob {
  height: 3px;
  margin-top: 8px;
}
.kb-act {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.kb-vazio {
  font-size: 11.5px;
  color: var(--ink-faint);
  padding: 14px 4px;
  text-align: center;
  border: 1px dashed var(--border-strong, var(--border));
  border-radius: 9px;
}

/* ---------- CRM: tarefas, linha do tempo ---------- */
.tasks {
  display: flex;
  flex-direction: column;
}
.task {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--border);
}
.task:last-child {
  border-bottom: 0;
}
.task-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.task.late .task-ic {
  background: var(--critical-soft, #fdecec);
}
.task-main {
  flex: 1;
  min-width: 0;
}
.task-t {
  font-weight: 600;
  font-size: 13px;
}
.task-m {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.due.late,
.due-t.late {
  color: var(--critical);
  font-weight: 650;
}
.due.today,
.due-t.today {
  color: var(--warn, #a15c00);
  font-weight: 650;
}
.task-act {
  display: flex;
  gap: 4px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.task-empty {
  color: var(--ink-faint);
  font-size: 13px;
  padding: 10px 2px;
}
.tl {
  position: relative;
  padding-left: 6px;
}
.tl::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}
.tl-item {
  display: flex;
  gap: 12px;
  padding: 7px 0;
  position: relative;
}
.tl-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: none;
  z-index: 1;
}
.tl-item.auto .tl-dot {
  background: var(--surface-2);
  font-size: 11px;
  color: var(--ink-faint);
}
.tl-body {
  flex: 1;
  min-width: 0;
}
.tl-h {
  display: flex;
  gap: 10px;
  align-items: baseline;
  font-size: 12.5px;
}
.tl-h span {
  color: var(--ink-faint);
  font-size: 11.5px;
}
.tl-del {
  margin-left: auto;
  opacity: 0;
  transition: opacity var(--dur-fast, 0.15s);
}
.tl-item:hover .tl-del,
.tl-del:focus-visible {
  opacity: 1;
}
.tl-t {
  font-size: 13px;
  margin-top: 2px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.tl-r {
  font-size: 12px;
  color: var(--ink-faint);
  margin-top: 2px;
}
.mini-list {
  display: flex;
  flex-direction: column;
}
.mini-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
}
.mini-row:last-child {
  border-bottom: 0;
}
.badge-n {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 100px;
  background: var(--critical);
  color: #fff;
  font-size: 10.5px;
  text-align: center;
  line-height: 17px;
}
@media (max-width: 720px) {
  .task {
    flex-wrap: wrap;
  }
  .task-act {
    width: 100%;
    justify-content: flex-start;
  }
}

button.step-chip {
  cursor: pointer;
}
button.step-chip:hover:not(.current) {
  border-color: var(--accent);
}

.sub-h {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-faint);
  margin: 0 0 6px;
}

/* faixa de situação da assinatura */
.ass-banner {
  padding: 9px 24px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.ass-banner.info {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.ass-banner.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.ass-banner.crit {
  background: var(--critical-soft);
  color: var(--critical);
}
.ass-banner[hidden] {
  display: none;
}

/* ---------- Consulta de CNPJ / CEP ---------- */
.consulta-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.consulta-row input {
  flex: 1;
  min-width: 0;
}
.consulta-btn {
  white-space: nowrap;
}
[data-consulta-status]:empty {
  display: none;
}
.consulta-ok {
  color: var(--success);
  animation: rise var(--dur) var(--ease-out);
}
.consulta-alerta {
  color: var(--warn);
  animation: rise var(--dur) var(--ease-out);
}
.consulta-erro {
  color: var(--critical);
  animation: rise var(--dur) var(--ease-out);
}
.consulta-carregando {
  color: var(--ink-muted);
}
.consulta-ok span,
.consulta-alerta span {
  color: var(--ink-muted);
}
.spin-mini {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent, #2563eb);
  border-radius: 50%;
  vertical-align: -1px;
  animation: spin 700ms linear infinite;
}
.auto-fill {
  animation: autofill 1.4s var(--ease-out);
}
@keyframes autofill {
  0% {
    background-color: color-mix(in srgb, var(--accent, #2563eb) 18%, transparent);
  }
  100% {
    background-color: transparent;
  }
}
@media (prefers-reduced-motion: reduce) {
  .consulta-ok,
  .consulta-alerta,
  .consulta-erro,
  .auto-fill,
  .spin-mini {
    animation: none;
  }
}

/* ---------- Área PrintWayy ---------- */
.pw-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.pw-tabs a.tab {
  text-decoration: none;
}
.pw-n {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  margin-left: 4px;
  border-radius: 100px;
  background: var(--surface-3);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: center;
}
.pw-n.crit {
  background: var(--critical);
  color: #fff;
}
.tab.active .pw-n {
  background: color-mix(in srgb, var(--bg) 30%, transparent);
  color: var(--bg);
}
#nav-pw-count {
  background: var(--critical);
  color: #fff;
}
.pw-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.pw-nivel {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 120px;
}
.pw-nivel .bar {
  flex: 1;
  height: 8px;
}
.pw-nivel b {
  font-family: var(--mono);
  font-size: 12px;
  min-width: 34px;
  text-align: right;
}
.pw-li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  animation: rise var(--dur) var(--ease-out) both;
}
.pw-li:first-of-type {
  border-top: 0;
}
.pw-li-main {
  flex: 1;
  min-width: 0;
}
.pw-li-main small {
  display: block;
  color: var(--ink-faint);
  font-size: 12px;
}
.pw-li-r {
  font-size: 12px;
  color: var(--ink-muted);
  white-space: nowrap;
}
.pw-li-n {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12.5px;
  min-width: 46px;
  text-align: center;
  padding: 3px 0;
  border-radius: 8px;
}
.pw-li-n.crit {
  background: var(--critical-soft);
  color: var(--critical);
}
.pw-li-n.baixo {
  background: var(--warn-soft);
  color: var(--warn);
}
.pw-li-vazio {
  color: var(--ink-faint);
  font-size: 13px;
  padding: 10px 0 2px;
}
.pw-ul {
  margin: 0;
  padding-left: 18px;
  line-height: 1.6;
  font-size: 13px;
}
.pw-tec {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.pw-tec-i {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-muted);
  padding-top: 4px;
}
.pw-faixa {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.pw-faixa-t {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
}
.pw-mini {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 12.5px;
  text-decoration: none;
}
.pw-mini b {
  font-family: var(--mono);
  color: var(--ink);
}
.pw-mini.crit {
  background: var(--critical-soft);
}
.pw-mini.crit b {
  color: var(--critical);
}
.pw-mini.warn {
  background: var(--warn-soft);
}
.pw-mini.warn b {
  color: var(--warn);
}
@media (prefers-reduced-motion: reduce) {
  .pw-li {
    animation: none;
  }
}

/* ---------- Janela de seleção para importar ---------- */
.sel-barra {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.sel-barra input[type="search"] {
  flex: 1;
  min-width: 160px;
}
.sel-n {
  font-size: 12px;
  color: var(--ink-muted);
  margin-left: auto;
}
.pw-imp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color var(--dur-fast),
    background-color var(--dur-fast),
    transform 100ms var(--ease-out);
}
.pw-imp:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pw-imp:active {
  transform: scale(0.99);
}
.pw-imp small {
  display: block;
  color: var(--ink-muted);
  font-size: 12.5px;
  margin-top: 2px;
}

/* Painel inicial: cartões de atenção grandes e coloridos */
.atn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}
.atn {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px 16px;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}
.atn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
}
.atn.red {
  background: linear-gradient(135deg, #e0483a, #f0775a);
}
.atn.blue {
  background: linear-gradient(135deg, #2954e5, #4f8df6);
}
.atn.orange {
  background: linear-gradient(135deg, #e8890c, #f5b73b);
}
.atn.purple {
  background: linear-gradient(135deg, #7a45d6, #a56cf0);
}
.atn-ic {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 34px;
  opacity: 0.35;
}
.atn-n {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.atn-l {
  font-size: 15px;
  font-weight: 700;
}
.atn-d {
  font-size: 13px;
  opacity: 0.92;
}
.dash-sup {
  border-top: 4px solid #e0483a;
}
.dash-rep {
  border-top: 4px solid #2954e5;
}
.atn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  font-size: 13px;
  color: var(--ink-muted);
}
.atn-chips a {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-soft, #e8eefc);
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.atn-chips a b {
  margin-right: 2px;
}

/* Painel: linhas compactas das listas */
.dli {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}
.dli:first-of-type {
  border-top: 0;
}
.dli-n {
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  padding: 5px 0;
  border-radius: 8px;
}
.dli-n.crit {
  background: #fde4e1;
  color: #c33b2e;
}
.dli-n.baixo {
  background: #fdeccd;
  color: #a15a07;
}
.dli-n.rep {
  background: #e2eafd;
  color: #2954e5;
}
.dli-t {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.dli-t b,
.dli-t small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dli-t small {
  color: var(--ink-faint);
  font-size: 12px;
}
.dli-r {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
@media (max-width: 560px) {
  .dli {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .dli-r {
    grid-column: 2;
  }
}
button.atn {
  border: 0;
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dash-qa .qa {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dash-qa .qa a {
  padding: 12px 14px;
}
.dash-qa .qa a b {
  margin-top: 4px;
}
@media (max-width: 760px) {
  .dash-qa .qa {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================================
   Tema azul v2 — menu marinho, menos escolhas na tela, cartões calmos
   ===================================================================== */
body {
  font-feature-settings: "tnum" 1;
}
.sidebar {
  background: var(--navy);
  border-right: 0;
  color: var(--navy-ink);
}
.sidebar .brand .name {
  color: #fff;
}
.sidebar .brand .name small {
  color: #8da3d4;
}
.sidebar .brand .mark {
  background: #fff;
  color: var(--navy);
}
.sidebar .navgroup .glabel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 2px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #8da3d4;
  cursor: pointer;
  user-select: none;
}
.sidebar .navgroup .glabel::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s ease;
}
.sidebar .navgroup .glabel:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}
.sidebar .navgroup.collapsed .glabel::after {
  transform: rotate(-45deg);
}
.sidebar .navgroup.collapsed .navitem {
  display: none;
}
.sidebar .navitem {
  color: var(--navy-ink);
}
.sidebar .navitem:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.sidebar .navitem.active {
  background: var(--accent);
  color: #fff;
}
.sidebar .navitem .badge {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-family: var(--sans);
  font-weight: 700;
}
.sidebar .navitem.active .badge {
  background: #fff;
  color: var(--accent-strong);
}
.sidebar :focus-visible {
  outline: 2px solid #8fb1ff;
  outline-offset: 1px;
}

/* Botões: poucos e claros; o resto fica em "Mais" */
.view-actions .more {
  position: relative;
}
.view-actions .more > summary {
  list-style: none;
  cursor: pointer;
}
.view-actions .more > summary::-webkit-details-marker {
  display: none;
}
.view-actions .more > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.view-actions .more[open] > summary {
  background: var(--surface-3);
}
.more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.more-menu .btn {
  justify-content: flex-start;
  background: transparent;
  border-color: transparent;
  width: 100%;
  border-radius: 8px;
}
.more-menu .btn:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.more-menu .btn.danger,
.more-menu .btn.danger-solid {
  color: var(--critical);
}

/* Início: cabeçalho azul, um número por coluna */
.hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 55%, var(--accent-strong) 100%);
  border-radius: 16px;
}
.hero::after {
  display: none;
}
.hero-kpis {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 22px;
}
.hero-kpi {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 2px 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.hero-kpi:first-child {
  padding-left: 0;
  border-left: 0;
}
@media (max-width: 700px) {
  .hero-kpis {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-kpi,
  .hero-kpi:first-child {
    padding: 0;
    border-left: 0;
  }
}
.hero-kpi .v {
  font-size: 28px;
}

/* Próximo passo (um por vez) */
.onb-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.onb-main .n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex: none;
}
.onb-main .t {
  flex: 1;
  min-width: 220px;
}
.onb-main .t b {
  font-size: 15.5px;
}
.onb details {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.onb summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--accent-strong);
}
.onb details .grid {
  margin-top: 12px;
}

/* Cartões de atenção: brancos, com uma faixa de cor só quando há o que fazer */
.atn {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.atn:hover {
  transform: none;
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.atn.red {
  background: var(--surface);
  border-left-color: var(--critical);
}
.atn.orange {
  background: var(--surface);
  border-left-color: var(--warn);
}
.atn.blue,
.atn.purple {
  background: var(--surface);
  border-left-color: var(--accent);
}
.atn.calmo {
  border-left-color: var(--border-strong);
}
.atn.calmo .atn-n {
  color: var(--ink-faint);
}
.atn-ic {
  display: none;
}
.atn-n {
  font-size: 34px;
  color: var(--accent-strong);
}
.atn.red .atn-n {
  color: var(--critical);
}
.atn.orange .atn-n {
  color: var(--warn);
}
.atn.calmo .atn-n {
  color: var(--ink-faint);
}
.atn-l {
  color: var(--ink);
}
.atn-d {
  color: var(--ink-muted);
  opacity: 1;
}

/* Precificação: o essencial na frente, o resto recolhido */
.mais-campos {
  grid-column: 1 / -1;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--surface);
}
.mais-campos > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--accent-strong);
}
.mais-campos[open] > summary {
  margin-bottom: 12px;
}
.eq-card {
  border-color: var(--border-strong);
}
.sidebar .navgroup {
  margin-top: 6px;
}
.sidebar .navgroup .glabel {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
}
.sidebar .navgroup:not(.collapsed) {
  margin-bottom: 6px;
}
.stat .k {
  font-size: 12.5px;
  font-weight: 600;
}
.mais-campos {
  margin: 14px 0;
}
.sidebar .versao {
  margin-top: auto;
  padding: 14px 10px 2px;
  font-size: 11.5px;
  color: #8da3d4;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.docfoot {
  align-items: center;
}
.docfoot-mais {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-right: auto;
}
.link-quieto {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--ink-muted);
  font: inherit;
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
}
.link-quieto:hover {
  color: var(--ink);
}

.ac-linha {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.ac-botoes {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.ac-links {
  display: flex;
  gap: 12px;
}
.ac-links .link-quieto,
td.acoes .link-quieto {
  font-size: 12px;
}
.link-quieto.perigo {
  color: var(--danger, #c33b2e);
}
td.acoes .link-quieto {
  margin-left: 8px;
}

/* Início: parque de máquinas em cores CMYK (ciano, magenta, amarelo) */
:root {
  --cmy-c: #22b8f0;
  --cmy-m: #ec3f93;
  --cmy-y: #f7c52b;
}
.pq-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.pq-head h1 {
  margin: 6px 0 0;
  max-width: 30ch;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.pq-data {
  font-size: 13px;
  color: var(--ink-muted);
}
.pq-n {
  color: var(--cmy-y);
  filter: brightness(0.9);
}
.pq-linha {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 900px) {
  .pq-linha {
    grid-template-columns: 1fr;
  }
}
.pq-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 14px;
}
.pq-top h3 {
  margin: 0;
  font-size: 18px;
}
.pq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 8px;
}
.pq-t {
  aspect-ratio: 1.15;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease;
}
.pq-t:hover,
.pq-t:focus-visible {
  transform: translateY(-2px);
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.pq-t.ok,
.pq-leg i.ok {
  background: var(--cmy-c);
}
.pq-t.chamado,
.pq-leg i.chamado {
  background: var(--cmy-m);
}
.pq-t.atencao,
.pq-leg i.atencao {
  background: var(--cmy-y);
}
.pq-t.semleitura,
.pq-leg i.semleitura {
  background: transparent;
  border: 2px dashed var(--ink-faint);
}
.pq-info {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink-muted);
  font-size: 14px;
  min-height: 44px;
}
.pq-leg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-muted);
}
.pq-leg i {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 4px;
  vertical-align: -1px;
}
.pq-side {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}
.pq-prev {
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.pq-prev .k {
  font-size: 14px;
  opacity: 0.85;
}
.pq-prev .v {
  margin: 4px 0 6px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.pq-prev .d {
  font-size: 13px;
  color: var(--navy-ink);
}
.pq-var {
  display: inline-block;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  font-weight: 600;
}
.pq-fecha {
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}
.pq-donut {
  --p: 0;
  flex: none;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, var(--surface) 72%, transparent 74%),
    conic-gradient(var(--cmy-c) calc(var(--p) * 1%), var(--surface-3) 0);
}
.pq-donut b {
  font-size: 18px;
}
.pq-ftxt {
  display: grid;
  gap: 2px;
}
.pq-ftxt small {
  color: var(--ink-muted);
  font-size: 13px;
}
.pq-li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 14px 16px;
  border-top: 1px solid var(--border);
  border-left: 4px solid var(--cmy-c);
  margin-left: 0;
}
.pq-li:first-of-type {
  border-top: 0;
}
.pq-li.m {
  border-left-color: var(--cmy-m);
}
.pq-li.y {
  border-left-color: var(--cmy-y);
}
.pq-li-t {
  display: grid;
  gap: 2px;
}
.pq-li-t b {
  font-size: 15px;
}
.pq-li-t small {
  color: var(--ink-muted);
  font-size: 13px;
}
@media (max-width: 600px) {
  .pq-li {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Perdas de toner */
.cst-li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.cst-li:first-child {
  border-top: 0;
}
.cst-n {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.cst-n small {
  font-weight: 400;
  color: var(--ink-muted);
}
.cst-n input {
  width: 100%;
}
.cst-v {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  color: var(--ink-muted);
}
.cst-v input {
  width: 110px;
  text-align: right;
}
.perda-v {
  color: var(--critical);
}

.perdas-barra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
}
.pd-li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.pd-li:first-of-type {
  border-top: 0;
}
.pd-li span {
  overflow-wrap: anywhere;
}

.cst-r input {
  width: 90px;
}
.cst-preco {
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--border);
}
.cst-n small {
  display: block;
}
