.brand-mark { overflow: hidden; }
.brand-logo { display:block; width:184px; height:auto; max-height:48px; object-fit:contain; object-position:left center; filter: invert(20%) sepia(28%) saturate(1240%) hue-rotate(174deg) brightness(83%) contrast(94%); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark.fallback::after { content: "M"; }

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 28px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(110deg, rgba(23,32,51,.96), rgba(13,20,36,.78));
}
.overview-head h2 { margin: 3px 0; font-size: clamp(24px, 3vw, 38px); }
.overview-head p:last-child { margin: 0; color: var(--muted); }

.file-drop {
  padding: 18px;
  border: 1px dashed #4a5870;
  border-radius: 11px;
  background: #0d1422;
  cursor: pointer;
}
.file-drop:hover { border-color: var(--accent); }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop span { color: var(--text); font-weight: 700; }
label small, .file-drop small { color: var(--muted); font-size: 11px; }
.selected-files { display: grid; gap: 6px; margin: -6px 0 15px; }
.file-chip { padding: 8px 10px; border-radius: 8px; background: var(--surface2); color: #cad1dd; font-size: 12px; }

@media (max-width: 720px) {
  .overview-head { align-items: flex-start; padding: 20px; }
  .overview-head .secondary { white-space: nowrap; font-size: 12px; }
}

/* Tema claro MARS */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface2: #edf1f6;
  --line: #dfe5ec;
  --text: #182131;
  --muted: #6f7b8d;
  --accent: #ef5b32;
  --accent2: #d74723;
  --green: #21a67a;
  --shadow: 0 20px 55px rgba(35, 48, 67, .09);
}
body { background: linear-gradient(135deg, #f7f9fb 0%, #eef2f6 100%); color: var(--text); }
.sidebar { background: rgba(255,255,255,.94); border-color: var(--line); box-shadow: 10px 0 40px rgba(35,48,67,.04); }
.brand { color: var(--text); }
.nav-item { color: #748094; }
.nav-item:hover, .nav-item.active { background: #f1f4f8; color: var(--text); }
.nav-item span svg { display: block; width: 19px; height: 19px; fill: currentColor; }
.nav-item span { vertical-align: middle; }
.stat i svg, .list-icon svg { width: 20px; height: 20px; fill: currentColor; }
.stat i { display: grid; place-items: center; }
.panel, .stat { background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.overview-head { background: linear-gradient(120deg, #fff, #f7f9fc); box-shadow: var(--shadow); }
input, select, textarea { background: #f8fafc; color: var(--text); }
.list-icon, .tag, .file-chip { background: #f1f4f8; }
.table-panel { background: #fff; }
td { color: #354052; }
.result-card { background: linear-gradient(140deg, #fc724b, #e84d2b); }
.file-drop { background: #f8fafc; }
.file-drop span { color: var(--text); }
.icon-button { background: #f0f3f7; color: var(--text); }
dialog { background: #fff; color: var(--text); }
dialog::backdrop { background: rgba(26,35,50,.35); }

.title-line { display: flex; align-items: center; gap: 10px; }
.title-line h1, .title-line h3 { margin: 0; }
.help-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #cbd4df;
  border-radius: 50%;
  background: #fff;
  color: #6a7688;
  font: 700 12px/1 inherit;
  cursor: pointer;
}
.help-button:hover { border-color: var(--accent); color: var(--accent); }
.help-button::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 9px);
  width: 210px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #202938;
  color: #fff;
  font: 500 11px/1.4 Inter, sans-serif;
  text-align: left;
  box-shadow: 0 10px 30px rgba(20,28,40,.2);
  opacity: 0;
  transform: translate(-50%, 5px);
  pointer-events: none;
  transition: .18s;
}
.help-button:hover::after, .help-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.help-button.mini { width: 19px; height: 19px; margin-left: 4px; }
.help-modal { padding: 28px; }
.help-modal #help-content { color: var(--muted); }
.help-modal ul { padding-left: 19px; }
.help-modal li { margin: 8px 0; }

.info-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.info-strip article { display: flex; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.75); }
.info-strip strong, .info-strip small { display: block; }
.info-strip small { margin-top: 3px; color: var(--muted); line-height: 1.35; }
.info-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 12px; background: #fff0eb; color: var(--accent); }
.info-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.recent-panel { margin-top: 14px; }

@media (max-width: 900px) { .info-strip { grid-template-columns: 1fr; } }

/* Paleta clara, cinzento-escuro e azul-marinho */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface2: #e9edf2;
  --line: #d9dee5;
  --text: #242b35;
  --muted: #707a87;
  --accent: #173b67;
  --accent2: #24588f;
  --green: #27856d;
  --shadow: 0 18px 48px rgba(29, 39, 52, .09);
}
body { background: linear-gradient(135deg, #f7f8fa 0%, #edf0f4 100%); }
.brand b, .eyebrow, .text-button, .tag { color: var(--accent2); }
.brand-mark { background: linear-gradient(145deg, #102d50, #285f96); box-shadow: 0 8px 24px rgba(23,59,103,.23); }
.primary { background: linear-gradient(135deg, #173b67, #24588f); box-shadow: 0 9px 28px rgba(23,59,103,.18); }
.nav-item.active { box-shadow: inset 3px 0 #173b67; }
.nav-item:hover, .nav-item.active { background: #e8edf3; color: #173b67; }
.info-icon { background: #e8eff7; color: #24588f; }
.result-card { background: linear-gradient(145deg, #173b67, #102b4c); box-shadow: 0 20px 52px rgba(16,43,76,.19); }
.help-button:hover { border-color: #24588f; color: #24588f; }
input:focus, select:focus, textarea:focus, .file-drop:hover { border-color: #24588f; }
.status-dot { background: #27856d; box-shadow: 0 0 12px rgba(39,133,109,.45); }
.help-modal h4 { margin: 22px 0 6px; color: var(--text); font-size: 14px; }
.help-modal p { line-height: 1.65; }

.result-card, .result-card span, .result-card strong, .result-card b { color: #ffffff; }
.result-card .eyebrow { color: #b9d7f5; }
.result-card .divider { background: rgba(255,255,255,.28); }
.result-card .breakdown span { background: rgba(5,20,38,.25); color: #c6d8eb; }
.client-summary { margin-top: 18px; border-left: 4px solid #24588f; }
.client-summary .panel-head { margin-bottom: 12px; }
.client-summary #client-message { margin: 0; color: #465365; font-size: 14px; line-height: 1.65; }
.copy-summary { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #ced7e2; border-radius: 9px; background: #f7f9fb; color: #173b67; font: 700 12px/1 Inter, sans-serif; cursor: pointer; }
.copy-summary:hover { border-color: #24588f; background: #edf3f9; }
.copy-summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.filter-panel { margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.filter-top { display: flex; align-items: center; gap: 12px; }
.advanced-search { min-height: 46px; background: #f7f9fb; }
.advanced-search svg { width: 19px; height: 19px; fill: none; stroke: #687588; stroke-width: 1.8; stroke-linecap: round; }
.advanced-search kbd { display: none; }
.clear-filters { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #5d6878; font: 700 12px/1 Inter, sans-serif; cursor: pointer; white-space: nowrap; }
.clear-filters:hover { border-color: #24588f; color: #173b67; }
.clear-filters svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.filter-groups { display: grid; grid-template-columns: minmax(420px, 1.8fr) repeat(3, minmax(150px, .65fr)); gap: 14px; align-items: end; margin-top: 16px; }
.filter-group { min-width: 0; }
.filter-label { display: block; margin-bottom: 7px; color: #758092; font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip { padding: 9px 11px; border: 1px solid #d9e0e8; border-radius: 999px; background: #f8fafc; color: #5f6b7d; font: 700 11px/1 Inter, sans-serif; cursor: pointer; transition: .18s; }
.filter-chip:hover { border-color: #8fa9c4; color: #173b67; }
.filter-chip.active { border-color: #173b67; background: #173b67; color: #fff; box-shadow: 0 5px 15px rgba(23,59,103,.15); }
.compact-filter { margin: 0; }
.compact-filter select { min-height: 40px; padding: 9px 34px 9px 11px; background-color: #f8fafc; font-size: 12px; }
.filter-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e5e9ef; color: #7a8595; font-size: 11px; }
#results-count { color: #263548; font-weight: 800; }

@media (max-width: 1180px) { .filter-groups { grid-template-columns: 1fr 1fr 1fr; } .type-filter { grid-column: 1 / -1; } }
@media (max-width: 720px) { .filter-top { align-items: stretch; flex-direction: column; } .clear-filters { justify-content: center; } .filter-groups { grid-template-columns: 1fr; } .type-filter { grid-column: auto; } .advanced-search kbd { display: none; } }

body { caret-color: transparent; }
input, textarea, [contenteditable="true"] { caret-color: #24588f; }
.price-lock-button { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0 17px; padding: 9px 12px; border: 1px solid #d6dfe9; border-radius: 9px; background: #f4f7fa; color: #36536f; font: 700 11px/1 Inter, sans-serif; cursor: pointer; }
.price-lock-button:hover { border-color: #24588f; background: #edf3f9; }
.price-lock-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.calc-form input:disabled { color: #657286; background: #eef2f6; cursor: not-allowed; }
.modal-description { margin: 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.danger-button { display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 0; border-radius: 9px; background: #c83d47; color: #fff; font: 700 13px/1 Inter, sans-serif; cursor: pointer; }
.danger-button:hover { background: #a92f39; }
.danger-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.confirm-modal, .detail-modal, .price-modal { padding: 28px; }
.confirm-modal { text-align: center; }
.confirm-modal .modal-actions { justify-content: center; }
.confirm-modal p { color: var(--muted); line-height: 1.55; }
.confirm-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 15px; border-radius: 18px; background: #fff0f0; color: #c83d47; animation: warning-pulse 1.8s ease-in-out infinite; }
.confirm-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@keyframes warning-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(200,61,71,.08); } }
.record-name { padding: 0; border: 0; background: transparent; color: #213d60; font: 700 14px/1.4 Inter, sans-serif; cursor: pointer; text-align: left; }
.record-name:hover { color: #24588f; text-decoration: underline; }
.row-actions button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row-actions button:first-child { color: #24588f; }
.row-actions button:last-child { color: #b53a45; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.detail-grid div, .detail-block { padding: 13px; border-radius: 10px; background: #f5f7fa; }
.detail-grid span, .detail-block > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.detail-grid strong, .detail-block strong { color: var(--text); }
.detail-block { margin-top: 12px; }
.detail-block a { color: #24588f; word-break: break-all; }
.detail-block p { margin: 0; line-height: 1.55; }
.detail-image { display: block; max-width: 100%; max-height: 180px; margin: 0 auto 16px; border-radius: 10px; object-fit: contain; }
.image-field { padding: 14px; border: 1px dashed #bdc9d7; border-radius: 10px; background: #f7f9fb; }
.image-field input[type="file"] { border: 0; background: transparent; padding: 5px 0; }
.image-field span { color: var(--muted); font-size: 11px; }
.image-field img { display: block; max-width: 120px; max-height: 90px; margin-top: 10px; border-radius: 8px; }

/* Alinhamento consistente dos campos da calculadora */
.calc-form .form-row { align-items: start; }
.calc-form .form-row > label { display: grid; grid-template-rows: 17px 42px auto; align-content: start; min-width: 0; }
.calc-form .form-row > label > input,
.calc-form .form-row > label > select { height: 42px; min-height: 42px; margin: 0; }
.calc-form .form-row > label > small { min-height: 16px; margin-top: 5px; line-height: 1.35; }
.calc-form > label:not(.file-drop) > input,
.calc-form > label:not(.file-drop) > select { height: 42px; min-height: 42px; }
.calc-image-field { padding: 14px; border: 1px dashed #bdc9d7; border-radius: 10px; background: #f7f9fb; }
.calc-image-field { cursor: pointer; transition: border-color .18s, box-shadow .18s, background .18s; }
.calc-image-field:hover, .calc-image-field:focus-within { border-color: #173b67; box-shadow: 0 0 0 3px rgba(23,59,103,.12); background: #f3f7fb; }
.calc-image-field input[type="file"] { border: 0; background: transparent; padding: 5px 0; }
.calc-image-field span { color: var(--muted); font-size: 11px; }
.paste-image-button { width: fit-content; margin-top: 8px; padding: 8px 12px; border: 1px solid #c6d4e3; border-radius: 8px; background: #fff; color: #173b67; font: 700 11px/1 Inter, sans-serif; cursor: pointer; }
.paste-image-button:hover { border-color: #173b67; background: #edf3f9; }
.remove-image-button { width: fit-content; margin-top: 8px; padding: 8px 12px; border: 1px solid #e1c5c8; border-radius: 8px; background: #fff8f8; color: #a8323d; font: 700 11px/1 Inter, sans-serif; cursor: pointer; }
.remove-image-button:hover { border-color: #a8323d; background: #fff0f1; }
.upload-progress { margin-top: 12px; }.upload-progress-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #dce5ef; }.upload-progress-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: #173b67; transition: width .18s ease; }.upload-progress small { display: block; margin-top: 5px; color: #6f7b8d; font-size: 11px; }
.calc-image-field img { display: block; max-width: 150px; max-height: 100px; margin-top: 10px; border-radius: 8px; object-fit: contain; }
.detail-modal { width: min(820px, calc(100% - 30px)); }
.detail-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: start; }
.detail-visual { min-height: 210px; display: grid; place-items: center; padding: 14px; border: 1px solid #e1e6ed; border-radius: 14px; background: linear-gradient(145deg,#f8fafc,#eef3f8); }
.detail-image { width: 100%; max-width: 190px; max-height: 220px; margin: 0; object-fit: contain; }
.detail-image-empty { color: #8a96a6; font-size: 12px; }
@media (max-width: 640px) { .detail-layout { grid-template-columns: 1fr; } .detail-visual { min-height: 150px; } }
