:root {
  --bg: #f3f5f7;
  --card: #ffffff;
  --text: #14243d;
  --muted: #64748b;
  --border: #dbe3ea;
  --primary: #024A3C;
  --primary-mid: #3A8756;
  --primary-light: #85C362;
  --primary-soft: #E7F7DE;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warning: #a16207;
  --warning-bg: #fffbeb;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 4px 14px rgba(15, 23, 42, 0.05);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  padding: 22px;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body.login-screen {
  display: grid;
  place-items: center;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.container {
  max-width: 1120px;
  margin: 0 auto;
}

.container.wide {
  max-width: 1220px;
}

.top-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-info span { color: var(--text); }
.user-info strong { font-weight: 700; }

.top-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.card,
.topbar,
.hero,
.panel,
.filters,
.metric-card,
.line-card,
.user-card,
.load-card,
.login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(219, 227, 234, 0.72);
  margin-bottom: 20px;
}

.hero-card { padding: 26px; }

.home-hero-head,
.hero,
.quote-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero {
  align-items: flex-start;
  background: var(--card);
}

.hero.compact { padding: 18px 20px; }

.home-hero-logo,
.login-logo,
.brand-logo {
  width: 96px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
}

.login-logo { width: 108px; margin-bottom: 12px; }

h1,
h2,
h3,
h4,
p { margin-top: 0; }

h1,
h2,
h3,
h4 { color: var(--text); }

h1 {
  font-size: 24px;
  line-height: 1.15;
  margin-bottom: 8px;
  font-weight: 700;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  margin-bottom: 12px;
  font-weight: 700;
}

h3,
h3.subheading {
  font-size: 15px;
  line-height: 1.25;
  margin: 18px 0 10px;
  font-weight: 700;
  color: var(--primary);
}

h4 { font-size: 15px; margin-bottom: 8px; font-weight: 700; }

p,
.subtitle {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.eyebrow,
.panel-kicker {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.home-grid,
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cards-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
}

.menu-card,
.metric-card {
  display: block;
  color: inherit;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 20px;
  min-height: 126px;
  box-shadow: none;
  margin-bottom: 0;
}

.menu-card:hover,
.metric-card:hover {
  background: #f1f5f9;
}

.menu-card h2,
.metric-card h2 { margin-bottom: 10px; }
.menu-card p { margin: 0; color: #475569; line-height: 1.5; }

.metric-card span {
  display: block;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric-card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.metric-card small,
small { color: var(--muted); line-height: 1.35; }
.metric-card.muted { background: #fbfcfd; }
.metric-card.highlight { background: var(--primary-soft); border-color: rgba(2,74,60,.18); }

label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 600;
}

input,
select,
textarea,
.select-box {
  width: 100%;
  padding: 12px 14px;
  margin-top: 6px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 15px;
  background: white;
  color: var(--text);
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus,
.select-box:focus {
  outline: none;
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(58, 135, 86, 0.18);
}

button,
.btn,
.home-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid rgba(2, 74, 60, 0.16);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}

button:hover,
.btn:hover,
.home-btn:hover {
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.btn-primary,
.home-btn.primary,
button.btn-primary {
  background: var(--primary-light);
  border-color: var(--primary-light);
  color: white;
  box-shadow: 0 8px 18px rgba(122, 193, 91, 0.22);
}

.btn-primary:hover,
.home-btn.primary:hover,
button.btn-primary:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.btn-danger,
button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.btn-danger:hover,
button.danger:hover { background: #991b1b; }

.actions,
.page-actions,
.actions-row,
.form-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.actions-row.end,
.page-actions.end { justify-content: flex-end; margin-top: 12px; }

.flash-wrap { margin-bottom: 16px; display: grid; gap: 8px; }
.flash,
.flash-success,
.flash-danger,
.flash-warning,
.flash-error {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}
.flash-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.flash-danger,
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: #fecaca; }
.flash-warning { background: var(--warning-bg); color: var(--warning); border-color: #fde68a; }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  background: white;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: white;
}

th,
td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
}

th {
  background: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
}

tr:last-child td { border-bottom: none; }
tr[onclick] { cursor: pointer; }
tr[onclick]:hover { background: #f8fafc; }

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

.badge,
.status-chip,
.warranty-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  background: var(--primary-soft);
  color: var(--primary);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
}

.filters input,
.filters select { margin-bottom: 0; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.align-start { align-items: start; }

.section-title,
.card-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 { margin-bottom: 0; }
.section-title a { color: var(--primary); font-weight: 700; }
.section-total { color: var(--primary); font-size: 18px; }

.form-stack { display: grid; gap: 4px; }

.status-form {
  display: flex;
  align-items: end;
  gap: 12px;
}
.status-form label { flex: 1; }
.status-form select { margin-bottom: 0; }

.info-list {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}
.info-list dt { color: var(--muted); font-weight: 700; }
.info-list dd { margin: 0; color: var(--text); font-weight: 400; word-break: break-word; }

.grid-info {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.grid-info div {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 12px;
  padding: 14px;
}
.grid-info span {
  display: block;
  color: #475569;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 6px;
  font-weight: 700;
}
.grid-info strong { display: block; font-size: 15px; font-weight: 600; line-height: 1.35; }

.load-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.load-card { box-shadow: none; padding: 16px; margin-bottom: 0; }
.load-card p { white-space: pre-wrap; margin-bottom: 10px; color: #475569; }

.proposal-form { display: grid; gap: 14px; }
.proposal-lines { display: grid; gap: 12px; }
.line-card { box-shadow: none; padding: 16px; margin-bottom: 0; }
.line-title { margin-bottom: 10px; }
.line-title span {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.line-title strong { font-size: 15px; font-weight: 700; }
.line-grid {
  display: grid;
  grid-template-columns: 2fr .8fr .9fr .9fr;
  gap: 12px;
  align-items: end;
}
.line-grid input { margin-bottom: 0; }
.terms-grid { margin-top: 4px; }
.price-input { max-width: 180px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; }
.checkbox-line input { width: auto; margin: 0; }
.user-list { display: grid; gap: 12px; }
.user-card { box-shadow: none; padding: 16px; margin-bottom: 0; }
.users-grid { grid-template-columns: 1.2fr 1.4fr .8fr 1fr; }

.login-shell { width: min(440px, calc(100vw - 44px)); margin: 0 auto; }
.login-card { padding: 26px; margin-bottom: 0; }
.login-card h1 { font-size: 24px; }
.login-card p { margin-bottom: 18px; }

/* Top card inspired by the Expedição screen */
.quote-top-card,
.dispatch-top-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(219, 227, 234, 0.72);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.quote-top-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.quote-reference h1 { margin: 0 0 4px 0; }
.quote-reference .subtitle { color: #334155; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.quote-mini-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.quote-mini-meta span {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 999px;
  padding: 7px 11px;
  color: #334155;
  font-size: 13px;
}
.quote-mini-meta strong { color: var(--text); margin-right: 4px; }
.quote-top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Printable proposal, closer to the conserto report */
.print-body { background: #ffffff; padding: 0; }
.print-document {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 34px 40px;
  margin: 22px auto;
  max-width: 1100px;
}
.print-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 22px;
  border-bottom: 2px solid #dbe3ea;
  margin-bottom: 22px;
}
.print-brand { display: flex; gap: 18px; align-items: flex-start; }
.print-brand img { width: 120px; height: auto; object-fit: contain; }
.print-company { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: #334155; }
.print-company strong { color: var(--text); font-size: 16px; margin-bottom: 2px; }
.print-title { min-width: 240px; text-align: right; }
.print-title h1 { margin-bottom: 10px; font-size: 28px; }
.print-title strong,
.print-title span { display: block; font-size: 14px; color: #334155; margin-top: 4px; }
.print-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 20px;
  margin: 18px 0;
}
.print-grid article,
.print-section {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
}
.print-grid h2,
.print-section h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--primary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #dbe3ea;
}
.print-grid p,
.print-section p { color: var(--text); margin: 4px 0; }
.print-table { font-size: 14px; min-width: 0; }
.print-table th,
.print-table td { border: 1px solid #dbe3ea; }
.print-table th { background: #f8fafc; color: var(--text); }
.print-table tfoot td { font-weight: 700; background: #f3f5f7; }
.print-footer { border-top: 1px solid #dbe3ea; margin-top: 18px; padding-top: 12px; font-size: 13px; color: #475569; }

@media (max-width: 980px) {
  body { padding: 14px; }
  .container { max-width: 100%; }
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters,
  .two-col,
  .grid-info,
  .load-grid,
  .print-grid,
  .line-grid,
  .users-grid { grid-template-columns: 1fr; }
  .hero,
  .quote-head,
  .home-hero-head,
  .quote-top-line { align-items: flex-start; grid-template-columns: 1fr; flex-direction: column; }
  .status-form { flex-direction: column; align-items: stretch; }
  .quote-top-actions { justify-content: flex-start; }
  .info-list { grid-template-columns: 1fr; gap: 3px; }
  .info-list dd { margin-bottom: 8px; }
}

@media (max-width: 640px) {
  body { padding: 10px; }
  .card,
  .topbar,
  .hero,
  .panel,
  .filters,
  .metric-card,
  .line-card,
  .user-card,
  .load-card,
  .login-card { padding: 16px; border-radius: 12px; }
  .home-grid,
  .cards-grid { grid-template-columns: 1fr; }
  .home-hero-logo { width: 74px; }
  h1 { font-size: 20px; }
  h2 { font-size: 16px; }
  .top-header { justify-content: flex-start; }
  .user-info { width: 100%; justify-content: space-between; }
  .top-nav { width: 100%; }
  .top-nav .home-btn { flex: 1 1 auto; }
  .actions-row,
  .page-actions,
  .form-actions-row { flex-direction: column; align-items: stretch; }
  .actions-row .btn,
  .page-actions .btn,
  .form-actions-row button,
  .home-btn { width: 100%; }
  table { min-width: 720px; }
  .print-header { flex-direction: column; }
  .print-title { min-width: 0; text-align: left; }
}

@media print {
  @page { size: A4 portrait; margin: 11mm 12mm 12mm 12mm; }
  html, body { width: 210mm; background: #fff; }
  body { padding: 0 !important; font-size: 11pt; line-height: 1.25; color: #000; }
  .top-header,
  .flash-wrap,
  .no-print { display: none !important; }
  .container { max-width: none; margin: 0; }
  .print-document { box-shadow: none; border-radius: 0; padding: 0 !important; margin: 0 !important; max-width: none; }
  .print-header { padding-bottom: 8mm; margin-bottom: 5mm; gap: 10mm; border-bottom: 1px solid #b9c1c9; }
  .print-brand img { width: 30mm; }
  .print-company { font-size: 8.8pt; gap: 1.5mm; }
  .print-company strong { font-size: 11pt; }
  .print-title h1 { font-size: 18pt; margin-bottom: 3mm; }
  .print-title strong, .print-title span { font-size: 9pt; }
  .print-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.5mm 3mm; }
  .print-grid article, .print-section { padding: 2.4mm 2.8mm; border-radius: 2mm; border: 1px solid #c9d1d9; page-break-inside: avoid; }
  .print-grid h2, .print-section h2 { font-size: 10pt; margin-bottom: 2.5mm; padding-bottom: 1.5mm; }
  .print-table { font-size: 9pt; }
  .print-footer { margin-top: 6mm; padding-top: 3mm; font-size: 8.5pt; }
}

/* v1.2 - limpeza visual inspirada na Expedição: cards como ações e menu de configurações */
:root {
  --primary: #0f172a;
  --primary-hover: #1e293b;
  --azevem-green-dark: #024A3C;
  --azevem-green-mid: #3A8756;
  --azevem-green-light: #85C362;
  --azevem-green-soft: #E7F7DE;
}

body {
  background: #f3f5f7;
  color: #14243d;
}

.container {
  max-width: 1120px;
}

h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 18px; font-weight: 650; }
h3, h3.subheading { font-weight: 650; color: #024A3C; }
h4 { font-weight: 650; }

p, .subtitle, small { color: #64748b; }

.top-header {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.user-info > span { color: #14243d; }
.user-info > strong { font-weight: 650; }

.settings-menu {
  position: relative;
  display: inline-block;
}

.settings-menu summary {
  list-style: none;
}

.settings-menu summary::-webkit-details-marker {
  display: none;
}

.settings-summary::after {
  content: "▾";
  font-size: 11px;
  margin-left: 2px;
}

.settings-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  min-width: 210px;
  background: #fff;
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
  padding: 8px;
  z-index: 50;
}

.settings-dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 9px;
  color: #14243d;
  font-weight: 600;
  font-size: 14px;
}

.settings-dropdown a:hover {
  background: #f1f5f9;
}

button, .btn, .home-btn {
  border-radius: 10px;
  border: none;
  background: #85C362;
  color: #ffffff;
  font-weight: 650;
  box-shadow: none;
}

button:hover, .btn:hover, .home-btn:hover {
  background: #024A3C;
  color: #ffffff;
  box-shadow: none;
}

.btn-primary, .home-btn.primary, button.btn-primary {
  background: #85C362;
  border-color: #85C362;
  color: #fff;
}

.card, .topbar, .hero, .panel, .filters, .metric-card, .line-card, .user-card, .load-card, .login-card {
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  border: 0;
}

.dashboard-hero {
  padding: 26px;
}

.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.dashboard-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  color: inherit;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  min-height: 118px;
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.dashboard-card:hover {
  background: #f1f5f9;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.dashboard-card.total-card {
  background: #E7F7DE;
  border-color: rgba(2, 74, 60, 0.18);
}

.dashboard-card-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 28px;
  font-weight: 750;
  line-height: 1;
  border: 1px solid #e5e7eb;
}

.dashboard-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 650;
}

.dashboard-card p {
  margin: 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.4;
}

.cards-grid, .home-grid { display: none; }
.recent-quotes-card { margin-top: 0; }

.dispatch-top-card, .quote-top-card, .cardless-panel, .nfe-paper {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(219, 227, 234, 0.72);
}

.dispatch-top-card { padding: 16px 18px; margin-bottom: 16px; }
.dispatch-top-line { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.simple-top-line { grid-template-columns: auto minmax(0, 1fr) 1px; }
.dispatch-reference h1 { margin: 0 0 4px 0; font-size: 24px; line-height: 1.15; font-weight: 650; }
.dispatch-customer { color: #334155; font-size: 14px; font-weight: 650; text-transform: uppercase; letter-spacing: .02em; }
.status-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 13px; border-radius: 999px; font-weight: 650; font-size: 13px; }
.status-open-bg { background: #dcfce7; color: #166534; }
.dispatch-top-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-top: 10px; }
.dispatch-mini-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 0; flex: 1 1 auto; min-width: 0; }
.dispatch-mini-meta span { background: #f8fafc; border: 1px solid #edf2f7; border-radius: 999px; padding: 7px 11px; color: #334155; font-size: 13px; }
.dispatch-mini-meta strong { color: #0f172a; margin-right: 4px; font-weight: 650; }
.dispatch-top-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
.header-action-btn, .header-action-form .header-action-btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 9px 13px; border: 1px solid rgba(2,74,60,.16); border-radius: 999px; background: #f8fafc; color: #0f172a; font-family: inherit; font-size: 13px; font-weight: 650; line-height: 1; text-decoration: none; white-space: nowrap; cursor: pointer; }
.header-action-btn:hover, .header-action-form .header-action-btn:hover { background: #fff; color: #0f172a; box-shadow: 0 8px 18px rgba(15,23,42,.08); }
.header-primary-btn, .header-action-form .header-primary-btn { background: #85C362; border-color: #85C362; color: #fff; box-shadow: 0 8px 18px rgba(122,193,91,.22); }
.header-primary-btn:hover, .header-action-form .header-primary-btn:hover { background: #024A3C; border-color: #024A3C; color: #fff; }
.header-danger-btn, .header-action-form .header-danger-btn { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.header-danger-btn:hover, .header-action-form .header-danger-btn:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

label { font-weight: 600; color: #334155; }
input, select, textarea, .select-box { font-weight: 400; color: #14243d; }

th { background: #024A3C; font-weight: 650; }
td { font-weight: 400; }
.table-wrap { box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05); }
.badge, .status-chip, .warranty-badge { font-weight: 600; }

.info-list dt { font-weight: 600; }
.info-list dd { font-weight: 400; }
.grid-info span { font-weight: 600; }
.grid-info strong { font-weight: 500; }

.proposal-form { gap: 12px; }
.line-card { padding: 15px; border: 1px solid #e5e7eb; background: #fff; }
.line-title { margin-bottom: 10px; }
.line-title span { display: inline-block; color: #024A3C; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 4px; }
.line-title strong { display: block; font-size: 15px; font-weight: 600; color: #14243d; }
.line-grid input[disabled] { background: #f8fafc; color: #334155; font-weight: 500; }
.section-title strong, .section-total { font-weight: 650; }

@media (max-width: 980px) {
  .dashboard-card-grid { grid-template-columns: 1fr; }
  .dispatch-top-toolbar { align-items: flex-start; flex-direction: column; }
  .dispatch-top-actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .dashboard-card { grid-template-columns: 58px minmax(0, 1fr); padding: 14px; }
  .dashboard-card-number { width: 50px; height: 50px; font-size: 23px; }
  .settings-menu { width: auto; }
  .settings-dropdown { right: auto; left: 0; }
  .dispatch-top-line { grid-template-columns: 1fr; align-items: stretch; }
  .dispatch-top-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .header-action-btn, .header-action-form, .header-action-form .header-action-btn { width: 100%; }
}

/* Detalhe da cotação: itens em cards com imagens, inspirados no formulário público */
.compact-section-title {
  align-items: center;
  margin-bottom: 14px;
}
.compact-section-title h2 { margin-bottom: 0; }
.detail-category-row {
  margin-top: 10px;
  margin-bottom: 10px;
}
.internal-items-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.internal-item-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: #fff;
  border: 1px solid rgba(29, 76, 56, 0.10);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(18, 64, 40, 0.05);
}
.internal-item-media {
  min-height: 104px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(240, 248, 242, 0.95), rgba(255,255,255,0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}
.internal-item-media img {
  width: 100%;
  max-width: 104px;
  max-height: 92px;
  object-fit: contain;
}
.internal-item-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 22px;
}
.internal-item-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.item-kind {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(133, 195, 98, 0.16);
  color: var(--primary);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.internal-item-body h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.internal-item-body p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.38;
}
.internal-item-body small {
  display: block;
  color: #64748b;
}
.internal-item-qty {
  min-width: 72px;
  min-height: 72px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  align-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid rgba(133, 195, 98, 0.24);
}
.internal-item-qty strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}
.internal-item-qty span {
  font-size: 12px;
  color: #45604c;
  margin-top: 4px;
}

/* Quadro elétrico: leitura por cards técnicos em vez de texto corrido */
.panel-spec-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.panel-spec-strip div {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 14px;
  padding: 12px 14px;
}
.panel-spec-strip span,
.electrical-chip-row small {
  display: block;
  color: #64748b;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  margin-bottom: 4px;
}
.panel-spec-strip strong {
  display: block;
  font-size: 14px;
  line-height: 1.25;
  font-weight: 600;
  color: var(--text);
}
.electrical-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.electrical-visual-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,252,249,0.92));
  border: 1px solid rgba(29, 76, 56, 0.10);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 8px 18px rgba(18, 64, 40, 0.05);
}
.electrical-visual-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}
.electrical-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  font-weight: 700;
  font-size: 18px;
}
.electrical-visual-head h4 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.electrical-visual-head p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.35;
}
.electrical-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.electrical-chip-row span {
  flex: 1 1 105px;
  min-width: 105px;
  border: 1px solid #edf2f7;
  background: #fff;
  border-radius: 12px;
  padding: 9px 10px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.25;
}
.electrical-lines {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.electrical-lines li {
  position: relative;
  padding-left: 18px;
  color: #334155;
  font-size: 14px;
  line-height: 1.42;
}
.electrical-lines li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary-light);
}
.muted-line {
  color: #64748b;
  margin: 0;
}

@media (max-width: 1100px) {
  .internal-items-grid,
  .electrical-visual-grid { grid-template-columns: 1fr; }
  .panel-spec-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .internal-item-card {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  .internal-item-media { min-height: 84px; border-radius: 14px; }
  .internal-item-media img { max-width: 82px; max-height: 76px; }
  .internal-item-qty {
    grid-column: 1 / -1;
    min-height: 52px;
    display: flex;
    gap: 6px;
    justify-content: center;
  }
  .internal-item-qty strong { font-size: 22px; }
  .panel-spec-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .electrical-chip-row span { flex-basis: 100%; }
}

/* MVP 1.7 — pente fino do detalhe técnico
   A tela interna precisa ajudar o operador a entender e precificar a solicitação,
   não repetir campos técnicos crus do formulário público. */
.smart-electrical-card {
  padding: 18px;
  background: #ffffff;
  border-color: rgba(2, 74, 60, 0.10);
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.045);
}
.smart-electrical-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.electrical-title-wrap {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}
.smart-electrical-head h4 {
  margin-top: 1px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.smart-electrical-head p {
  margin-top: 3px;
  font-size: 13px;
  color: #64748b;
}
.electrical-count-badge {
  min-width: 92px;
  border-radius: 16px;
  padding: 10px 12px;
  text-align: center;
  background: var(--primary-soft);
  border: 1px solid rgba(133, 195, 98, 0.22);
  color: var(--primary);
}
.electrical-count-badge strong {
  display: block;
  font-size: 23px;
  line-height: 1;
  font-weight: 750;
}
.electrical-count-badge span {
  display: block;
  margin-top: 4px;
  color: #42624d;
  font-size: 12px;
  line-height: 1.1;
}
.electrical-fact-list {
  display: grid;
  gap: 8px;
}
.electrical-fact-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #edf2f7;
  border-radius: 13px;
  background: #fbfdfc;
}
.electrical-fact-row span {
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .045em;
  font-weight: 700;
}
.electrical-fact-row strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
@media (max-width: 680px) {
  .smart-electrical-head { align-items: stretch; }
  .electrical-count-badge { min-width: 78px; }
  .electrical-fact-row { grid-template-columns: 1fr; gap: 4px; }
}

/* v1.8 - proposta operacional: menos formulário, mais mesa de precificação */
.proposal-page-head { margin-bottom: 14px; }
.proposal-head-grid {
  display: grid;
  grid-template-columns: 1.35fr repeat(3, minmax(130px, .65fr));
  gap: 10px;
  margin-top: 14px;
}
.proposal-kpi {
  background: #f8fafc;
  border: 1px solid #edf2f7;
  border-radius: 14px;
  padding: 13px 14px;
  min-height: 78px;
}
.proposal-kpi span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: 8px;
}
.proposal-kpi strong {
  display: block;
  color: #0f172a;
  font-size: 23px;
  line-height: 1;
  font-weight: 700;
}
.total-kpi { background: #E7F7DE; border-color: rgba(2,74,60,.16); }
.total-kpi strong { color: #024A3C; }
.attention-kpi { background: #fff7ed; border-color: #fed7aa; }
.attention-kpi strong { color: #c2410c; }
.proposal-workspace { display: grid; gap: 14px; }
.proposal-command-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 0;
}
.proposal-command-bar h2 { margin-bottom: 5px; }
.proposal-command-bar p { max-width: 680px; }
.proposal-command-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  flex: 0 0 auto;
}
.proposal-editor { display: grid; gap: 14px; }
.proposal-section-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(219, 227, 234, 0.72);
  overflow: hidden;
}
.proposal-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-bottom: 1px solid #edf2f7;
  background: #fbfcfd;
}
.proposal-section-head h2 { margin: 0 0 4px; font-weight: 650; }
.proposal-section-head p { margin: 0; font-size: 14px; }
.proposal-section-head > strong {
  color: #024A3C;
  background: #E7F7DE;
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 15px;
  white-space: nowrap;
}
.proposal-line-list { display: grid; }
.proposal-edit-line {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 410px;
  gap: 14px;
  align-items: start;
  padding: 14px 18px;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
}
.proposal-edit-line:last-child { border-bottom: 0; }
.proposal-edit-line.missing-price { background: linear-gradient(90deg, #fff7ed, #fff 22%); }
.proposal-line-media {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: linear-gradient(180deg, #f0f8f2, #fff);
  border: 1px solid rgba(2,74,60,.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px;
}
.proposal-line-media img { max-width: 100%; max-height: 100%; object-fit: contain; }
.proposal-line-media span {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #0f172a;
  color: #fff;
  font-weight: 700;
  font-size: 19px;
}
.proposal-line-media.block-media { background: #f8fafc; }
.proposal-line-type {
  color: #024A3C;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.proposal-description-input {
  margin: 0 0 8px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 550;
}
.proposal-note-input {
  margin: 0;
  min-height: 48px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13px;
  color: #475569;
}
.proposal-price-grid {
  display: grid;
  grid-template-columns: .7fr .95fr .95fr;
  gap: 10px;
  align-items: start;
}
.proposal-price-grid label {
  margin: 0;
  color: #64748b;
  font-size: 11px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.proposal-price-grid input {
  margin: 5px 0 0;
  padding: 10px 11px;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
.proposal-price-grid input[disabled] {
  background: #f8fafc;
  color: #0f172a;
  font-weight: 650;
}
.proposal-details-panel { margin-bottom: 0; padding: 0; overflow: hidden; }
.proposal-details-panel summary {
  cursor: pointer;
  padding: 16px 18px;
  color: #0f172a;
  font-weight: 650;
  list-style: none;
  border-bottom: 1px solid #edf2f7;
}
.proposal-details-panel summary::-webkit-details-marker { display: none; }
.proposal-details-panel summary::after { content: "▾"; float: right; color: #64748b; }
.proposal-terms-grid,
.internal-only-panel > textarea,
.internal-only-panel > p { padding: 16px 18px 4px; }
.proposal-terms-grid textarea { min-height: 88px; }
.internal-only-panel > textarea { margin: 0 18px 18px; width: calc(100% - 36px); }
.internal-only-panel > p { margin: 0; }
.floating-save-bar {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(8px);
  border: 1px solid #dbe3ea;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,.14);
  padding: 12px 14px;
}
.floating-save-bar span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.floating-save-bar strong { color: #024A3C; font-size: 20px; }

/* v1.8 - documento comercial */
.proposal-print-document { max-width: 980px; }
.proposal-print-header { align-items: flex-start; }
.print-summary-strip {
  display: grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap: 10px;
  margin-bottom: 14px;
}
.print-summary-strip article,
.print-total-row {
  border: 1px solid #dbe3ea;
  border-radius: 12px;
  padding: 12px 14px;
  background: #f8fafc;
}
.print-summary-strip span,
.print-total-row span {
  display: block;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
}
.print-summary-strip strong,
.print-total-row strong { color: #0f172a; font-size: 15px; }
.print-total-box { background: #E7F7DE !important; border-color: rgba(2,74,60,.18) !important; }
.print-total-box strong { color: #024A3C; font-size: 18px; }
.print-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}
.print-section-head h2 { margin: 0; }
.print-section-head strong { color: #024A3C; }
.commercial-print-table td:first-child { width: 52%; }
.print-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #E7F7DE;
  border-color: rgba(2,74,60,.22);
  margin: 12px 0 14px;
}
.print-total-row span { margin: 0; }
.print-total-row strong { color: #024A3C; font-size: 22px; }

@media (max-width: 980px) {
  .proposal-head-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .proposal-command-bar { flex-direction: column; align-items: stretch; }
  .proposal-command-actions { justify-content: flex-start; }
  .proposal-edit-line { grid-template-columns: 72px minmax(0, 1fr); }
  .proposal-price-grid { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .proposal-head-grid { grid-template-columns: 1fr; }
  .proposal-edit-line { grid-template-columns: 1fr; }
  .proposal-line-media { width: 66px; height: 66px; }
  .proposal-price-grid { grid-template-columns: 1fr; }
  .proposal-command-actions { display: grid; grid-template-columns: 1fr; }
  .proposal-command-actions > * { width: 100%; }
  .floating-save-bar { left: 8px; right: 8px; bottom: 8px; }
}
@media print {
  .print-summary-strip { grid-template-columns: 1.1fr .85fr .85fr; gap: 2.5mm; margin-bottom: 4mm; }
  .print-summary-strip article, .print-total-row { border-radius: 2mm; padding: 2.5mm 3mm; }
  .print-summary-strip span, .print-total-row span { font-size: 7.8pt; margin-bottom: 1.5mm; }
  .print-summary-strip strong { font-size: 9.2pt; }
  .print-total-box strong { font-size: 11pt; }
  .print-section-head { margin-bottom: 2.5mm; }
  .print-total-row { margin: 3mm 0 4mm; }
  .print-total-row strong { font-size: 14pt; }
}
