:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --surface-soft: #eef4f2;
  --ink: #162120;
  --muted: #61706d;
  --line: #d7e1de;
  --line-strong: #a8bbb6;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #dff3ef;
  --warning: #b45309;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --focus: #2563eb;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Logo da marca no topo (clicável → página inicial) */
.brand-link {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.brand-logo-svg {
  height: 58px;
  width: auto;
  display: block;
}

.topbar,
.supplier-header {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topbar h1,
.supplier-header h1,
.workspace-header h2,
.supplier-toolbar h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.supplier-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 4px;
}

.supplier-header p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.top-actions,
.workspace-actions,
.supplier-actions,
.form-actions,
.tool-row,
.supplier-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 0;
  position: relative;
  transition: grid-template-columns 0.18s ease;
}

.sidebar {
  padding: 18px;
  background: #fbfdfc;
  border-right: 1px solid var(--line);
  overflow: auto;
}

/* Barra lateral recolhível */
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sidebar-head .eyebrow {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #98a2b3;
  font-weight: 700;
}
.sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  color: #475467;
  flex: none;
}
.sidebar-toggle:hover {
  background: #f1f5f4;
}
.layout.sidebar-collapsed {
  grid-template-columns: minmax(0, 1fr);
}
.layout.sidebar-collapsed .sidebar {
  display: none;
}
/* Quando recolhida, abre espaço pro botão flutuante de expandir. */
.layout.sidebar-collapsed .workspace {
  padding-left: 54px;
}
#sidebarExpand {
  display: none;
  position: absolute;
  top: 14px;
  left: 10px;
  z-index: 20;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}
.layout.sidebar-collapsed #sidebarExpand {
  display: inline-flex;
}

.workspace {
  padding: 22px;
  overflow: auto;
}

.upload-box {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.file-label span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.primary-button,
.ghost-button,
.danger-ghost,
.ghost-link,
.icon-button,
.tab-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 750;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.primary-button {
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.ghost-button,
.ghost-link {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.compact-link {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.ghost-button:hover,
.ghost-link:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.danger-ghost {
  padding: 0 12px;
  border: 1px solid #f3b5af;
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button {
  width: 40px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.icon-button:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.icon-button.danger {
  color: var(--danger);
}

.full {
  width: 100%;
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
}

.quote-list {
  display: grid;
  gap: 8px;
}

.quote-list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  color: var(--ink);
}

.quote-list-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.quote-title {
  font-weight: 850;
}

.quote-subtitle,
.quote-meta,
.muted,
.compact {
  color: var(--muted);
}

.quote-subtitle,
.quote-meta {
  font-size: 13px;
}

.compact {
  margin: 0;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.process-funnel {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.process-funnel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.process-funnel-title h2 {
  margin: 0;
  font-size: 18px;
}

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

.process-lane {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.process-lane.em_cotacao {
  border-color: #f0c48d;
}

.process-lane.concluido {
  border-color: #8ecab8;
}

.process-lane.descartado {
  border-color: #e7b4b4;
  background: #fcf6f6;
}

.process-card-list {
  display: grid;
  gap: 8px;
}

.process-card {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.process-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.process-card strong,
.process-card small,
.process-card span {
  min-width: 0;
}

.process-card small {
  color: var(--muted);
}

.workspace-header p {
  margin: 4px 0 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.metric {
  min-height: 74px;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.metric span {
  font-size: 24px;
  font-weight: 850;
}

.metric small {
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.tab-button {
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}

.tab-button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.tab-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.documents-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.documents-box-head,
.document-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.documents-box-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.documents-list {
  display: grid;
  gap: 8px;
}

.document-line {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.document-type {
  flex: 0 0 auto;
  min-width: 68px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}

.document-name {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.search-field {
  position: relative;
  flex: 1 1 220px;
}

.search-field svg {
  position: absolute;
  left: 10px;
  top: 12px;
  color: var(--muted);
}

.search-field input {
  padding-left: 36px;
}

.tool-row {
  margin-bottom: 12px;
}

.notice-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-weight: 750;
}

.notice-line.warn {
  background: #fff4e5;
  border-color: #f0b15a;
  color: #92400e;
}

.desc-cell {
  position: relative;
}

.desc-expand {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  background: #fff;
  color: var(--primary-dark, #0f766e);
  cursor: pointer;
  opacity: 0.85;
}

.desc-expand:hover {
  opacity: 1;
  background: var(--primary-soft, #ecfdf5);
}

.desc-expand i {
  width: 13px;
  height: 13px;
}

.desc-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 1000;
}

.desc-modal {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.desc-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line, #e2e8f0);
}

.desc-modal-head strong {
  font-size: 16px;
  color: var(--primary-dark, #0f766e);
}

.desc-modal-body {
  padding: 16px;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 15px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

th {
  background: #f8fbfa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.items-table td:nth-child(4) {
  min-width: 360px;
}

.responses-table td:first-child {
  min-width: 300px;
}

.responses-table td:first-child span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.center-cell {
  text-align: center;
}

.check-input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--primary);
}

.short-input {
  min-width: 92px;
}

.product-input {
  min-width: 190px;
}

.description-input {
  min-height: 58px;
}

.empty-cell,
.empty-inline {
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.supplier-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.3fr) minmax(140px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.supplier-list {
  display: grid;
  gap: 10px;
}

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

.pipeline-lane {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.pipeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.pipeline-head strong {
  display: inline-flex;
  min-width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

.empty-lane {
  min-height: 86px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.supplier-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.supplier-card.em_cotacao {
  border-color: #f0c48d;
}

.supplier-card.concluido {
  border-color: #8ecab8;
}

.supplier-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.supplier-card h3 {
  margin: 0 0 3px;
}

.supplier-card p,
.supplier-card small {
  margin: 0;
}

.status-pill {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.status-pill.em_cotacao {
  background: #fff2d8;
  color: #92400e;
}

.status-pill.concluido {
  background: #dff3ef;
  color: var(--primary-dark);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 13px;
  text-decoration: none;
  border: 1px solid var(--border, #e2e8f0);
  width: fit-content;
}

.back-link:hover {
  background: #dff3ef;
}

.back-link i {
  width: 16px;
  height: 16px;
}

.pregao-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 2px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff2d8;
  color: #92400e;
  font-size: 13px;
  font-weight: 700;
  width: fit-content;
}

.pregao-date strong {
  font-weight: 850;
}

.pregao-date.sem-data {
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 600;
}

.pregao-date i {
  width: 15px;
  height: 15px;
}

.assign-input {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 10px;
}

/* Tabela de itens cabe inteira sem rolagem horizontal (no desktop). */
.items-table {
  width: 100%;
  table-layout: fixed;
}

.items-table th,
.items-table td {
  padding: 6px 8px;
}

.items-table input,
.items-table textarea,
.items-table select {
  width: 100%;
  box-sizing: border-box;
}

.items-table th:nth-child(1),
.items-table td:nth-child(1) { width: 44px; }
.items-table th:nth-child(2),
.items-table td:nth-child(2) { width: 52px; }
.items-table th:nth-child(3),
.items-table td:nth-child(3) { width: 15%; }
.items-table th:nth-child(5),
.items-table td:nth-child(5) { width: 60px; }
.items-table th:nth-child(6),
.items-table td:nth-child(6) { width: 96px; }
.items-table th:nth-child(7),
.items-table td:nth-child(7) { width: 140px; }
.items-table th:nth-child(8),
.items-table td:nth-child(8) { width: 40px; }

.config-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 0 40px;
}

.config-intro .muted {
  font-size: 14px;
}

.config-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 16px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.config-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-card-head h2 {
  margin: 0;
  font-size: 18px;
}

.config-sellers {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.seller-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft, #f1f5f9);
  flex-wrap: wrap;
}

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

.seller-info code {
  background: rgba(0, 0, 0, 0.06);
  padding: 1px 6px;
  border-radius: 6px;
  font-weight: 700;
}

.seller-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seller-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.seller-form input {
  flex: 1 1 180px;
}

.produtos-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  max-height: 320px;
  overflow: auto;
}

.produto-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-soft, #f1f5f9);
}

.agenda-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.agenda-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
}

.agenda-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.agenda-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-soft, #f1f5f9);
}

.agenda-item-title {
  font-size: 14px;
  margin-bottom: 4px;
}

.agenda-item-mins {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.agenda-min {
  font-size: 14px;
}

.agenda-min b {
  font-weight: 800;
  color: var(--primary-dark, #0f766e);
}

.agenda-table td,
.agenda-table th {
  vertical-align: top;
  padding: 10px 12px;
}

.agenda-table td:first-child a {
  font-weight: 800;
  color: var(--primary-dark, #0f766e);
  text-decoration: none;
}

.agenda-table tr.agenda-row-first td {
  border-top: 2px solid var(--line, #e2e8f0);
}

.agenda-table td:last-child {
  font-weight: 700;
  white-space: nowrap;
}

.ai-button {
  border-color: #7c3aed !important;
  color: #6d28d9 !important;
}

.ai-button:hover {
  background: #f5f3ff !important;
}

.detail-topbar {
  margin-bottom: 10px;
}

.process-card {
  cursor: pointer;
  position: relative;
}

.process-card-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #b42318;
  opacity: 0.5;
  cursor: pointer;
}

.process-card-del:hover {
  opacity: 1;
  background: rgba(180, 35, 24, 0.1);
}

.process-card-del i {
  width: 14px;
  height: 14px;
}

.process-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 4px 0;
}

.process-card-meta span b {
  font-weight: 800;
}

.quote-list-item {
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding-right: 30px;
}

.supplier-timeline {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.progress-line {
  height: 8px;
  margin: 10px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.progress-line span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.message-form {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.message-list {
  display: grid;
  gap: 10px;
}

.message {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message.from-supplier {
  border-color: #f0c48d;
  background: #fff8ed;
}

.message div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.message p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.message time {
  color: var(--muted);
  font-size: 12px;
}

.empty-state {
  min-height: 360px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 42px;
  height: 42px;
  color: var(--primary);
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: var(--danger);
}

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

.supplier-main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px;
  display: grid;
  gap: 14px;
}

.login-panel,
.thurow-toolbar,
.thurow-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.login-panel {
  width: min(420px, 100%);
  margin: 34px auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.login-panel h2,
.thurow-toolbar h2,
.thurow-card h3 {
  margin: 0;
}

.thurow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.thurow-list {
  display: grid;
  gap: 10px;
}

.thurow-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
}

.thurow-card.em_cotacao {
  border-color: #f0c48d;
}

.thurow-card.concluido {
  border-color: #8ecab8;
}

.supplier-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.supplier-summary div,
.supplier-object,
.quote-item,
.supplier-messages {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.supplier-summary div {
  min-height: 74px;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.supplier-summary span,
.quote-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.supplier-summary strong {
  font-size: 21px;
}

.supplier-object,
.supplier-messages {
  padding: 14px;
}

.supplier-object h2,
.supplier-object p {
  margin: 0;
}

.supplier-object h2 {
  margin-bottom: 6px;
  font-size: 16px;
}

.quote-form {
  display: grid;
  gap: 12px;
}

.quote-item {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.quote-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, auto);
  gap: 12px;
  align-items: start;
}

.item-number {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

/* ===================== CELULAR (responsivo) ===================== */
@media (max-width: 760px) {
  /* Evita o zoom automático do iOS ao focar campos */
  input,
  select,
  textarea,
  .short-input,
  .product-input,
  .description-input,
  .assign-input {
    font-size: 16px;
  }

  /* Cabeçalhos */
  .topbar,
  .supplier-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
    min-height: 0;
  }
  .topbar h1,
  .supplier-header h1 {
    font-size: 20px;
  }
  .top-actions,
  .workspace-actions {
    width: 100%;
  }
  .top-actions > *,
  .workspace-actions > * {
    flex: 1 1 auto;
    justify-content: center;
  }

  /* Painel do comprador vira coluna única */
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 14px;
  }
  .workspace {
    padding: 14px;
  }
  .workspace-header {
    flex-direction: column;
    align-items: stretch;
  }
  .metric-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .process-lanes {
    grid-template-columns: 1fr;
  }

  /* Abas roláveis na horizontal */
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab-button {
    white-space: nowrap;
  }

  /* Tabelas largas rolam na horizontal */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ---------- PORTAL DO FORNECEDOR (uso no celular) ---------- */
  .supplier-main {
    padding: 14px;
  }
  .supplier-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .thurow-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .thurow-toolbar .top-actions {
    width: 100%;
  }
  .thurow-card {
    flex-direction: column;
    align-items: stretch;
  }
  .thurow-card .primary-button {
    width: 100%;
    justify-content: center;
  }

  .supplier-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .supplier-toolbar h2 {
    font-size: 18px;
  }
  .supplier-toolbar .primary-button {
    width: 100%;
    justify-content: center;
  }

  .quote-item-head {
    grid-template-columns: 1fr;
  }
  .quantity-box {
    justify-self: start;
  }
  .quote-grid,
  .quote-grid.simple {
    grid-template-columns: 1fr;
  }

  .login-panel {
    width: 100%;
  }

  /* Alvos de toque maiores */
  .primary-button,
  .ghost-button,
  .danger-ghost,
  .ghost-link,
  .back-link,
  .tab-button {
    min-height: 44px;
  }
}

.quote-item h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.quantity-box {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.quantity-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.quote-grid.simple,
.quote-fixed-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quote-fixed-row {
  display: grid;
  gap: 10px;
}

.quote-fixed-row div {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fbfa;
}

.quote-fixed-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.quote-fixed-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quote-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.quote-total strong {
  font-size: 17px;
}

.is-busy {
  position: relative;
}

@media (max-width: 1040px) {
  .layout {
    grid-template-columns: 280px minmax(0, 1fr);
  }

  .metric-row,
  .supplier-summary,
  .quote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .supplier-form,
  .message-form {
    grid-template-columns: 1fr 1fr;
  }

  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .supplier-form button,
  .message-form button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    padding: 16px;
  }

  .top-actions,
  .workspace-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .layout {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: none;
  }

  .workspace {
    padding: 14px;
  }

  .workspace-header {
    display: grid;
  }

  .process-funnel-title,
  .thurow-toolbar,
  .thurow-card {
    grid-template-columns: 1fr;
    display: grid;
  }

  .process-lanes {
    grid-template-columns: 1fr;
  }

  .metric-row,
  .form-grid.two,
  .supplier-summary,
  .quote-fixed-row,
  .quote-grid.simple,
  .quote-grid,
  .supplier-form,
  .message-form {
    grid-template-columns: 1fr;
  }

  .tab-panel {
    padding: 12px;
    box-shadow: none;
  }

  .supplier-card {
    grid-template-columns: 1fr;
  }

  .supplier-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 44px;
  }

  .quote-item-head {
    grid-template-columns: 1fr;
  }

  .supplier-main {
    padding: 12px;
  }
}

@media (max-width: 460px) {
  .topbar h1,
  .supplier-header h1,
  .workspace-header h2 {
    font-size: 21px;
  }

  .top-actions,
  .workspace-actions,
  .supplier-actions {
    grid-template-columns: 1fr;
  }

  .primary-button,
  .ghost-button,
  .danger-ghost,
  .ghost-link {
    width: 100%;
  }

  .tabs {
    gap: 6px;
  }

  .tab-button {
    min-width: 108px;
  }
}
