/* =========================================================================
   INTEGRAL GEO MATRÍCULA — estilos
   Identidade: SaaS/GIS técnico corporativo. Fundo claro, sidebar escura,
   cards brancos, cantos discretamente arredondados, tipografia moderna.
   ========================================================================= */

:root{
  --bg: #f3f4f7;
  --surface: #ffffff;
  --border: #e3e5eb;
  --border-strong: #d3d6de;

  --text-primary: #171a21;
  --text-secondary: #5b6072;
  --text-muted: #8a8fa3;

  --sidebar-bg: #0c1220;
  --sidebar-bg-elevated: #121a2c;
  --sidebar-text: #aab2c8;
  --sidebar-text-active: #ffffff;
  --sidebar-border: #1d2438;

  --accent: #1d4ed8;
  --accent-dark: #1737a6;
  --accent-soft: #e8edfc;
  --accent-contrast: #ffffff;

  --teal: #0d9488;
  --teal-soft: #e3f6f3;

  --ok: #0f9d58;
  --ok-soft: #e5f6ec;
  --warn: #b7791f;
  --warn-soft: #fdf3e0;
  --error: #c0362c;
  --error-soft: #fbe9e7;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

*, *::before, *::after{ box-sizing: border-box; }

html, body{
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button, input{ font-family: inherit; }

/* ============================== LAYOUT ============================== */

.app-shell{
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.main{
  padding: 40px 48px 80px;
  max-width: 1180px;
  width: 100%;
}

.view{ display: none; }
.view.active{ display: block; }

.view-header{ margin-bottom: 28px; }
.view-header-row{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.view-header-row .btn-sm{ margin-top: 2px; flex-shrink: 0; }
.view-header h1{
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.view-header p{
  margin: 0;
  color: var(--text-secondary);
  font-size: 15px;
  max-width: 640px;
  line-height: 1.5;
}

/* ============================== SIDEBAR ============================== */

.sidebar{
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 28px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 28px;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 20px;
}

.brand-mark{
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--accent), var(--accent-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.brand-text{ display: flex; flex-direction: column; line-height: 1.15; }
.brand-line1{
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.brand-accent{ color: #8fb4ff; font-weight: 800; }
.brand-line2{
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
}

.nav{ display: flex; flex-direction: column; gap: 2px; flex: 1; }

.nav-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover{ background: var(--sidebar-bg-elevated); color: #fff; }
.nav-item.active{
  background: var(--sidebar-bg-elevated);
  color: var(--sidebar-text-active);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-icon{ width: 18px; height: 18px; flex-shrink: 0; opacity: 0.9; }

.sidebar-footer{
  border-top: 1px solid var(--sidebar-border);
  padding-top: 18px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-credit{
  padding: 12px 2px 0;
  margin-top: 2px;
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.footer-credit-company{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #8890a6;
}
.footer-credit-dev{
  font-size: 10.5px;
  color: #565e77;
}

.status-pill{
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  text-align: center;
  border: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
}
.status-pill--idle{ background: var(--sidebar-bg-elevated); }
.status-pill--processing{ background: #21305a; color: #cfe0ff; border-color: #2d3f72; }
.status-pill--ok{ background: #0e3a2c; color: #8be3bb; border-color: #145a41; }
.status-pill--error{ background: #3a1414; color: #ffb4a8; border-color: #5a1c1c; }

.project-switcher{ display: flex; flex-direction: column; gap: 5px; }
.project-switcher-label{
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #737b93;
  padding: 0 2px;
}
.project-select{
  width: 100%;
  background: var(--sidebar-bg-elevated);
  color: #fff;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.project-select:focus{ outline: none; border-color: var(--accent); }

/* ============================== CARDS ============================== */

.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.card h3{
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 700;
}

/* ============================== UPLOAD ============================== */

.upload-card{ max-width: 680px; }

.dropzone{
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 44px 24px;
  text-align: center;
  background: #fafbfc;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.dragover{
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon{ width: 34px; height: 34px; color: var(--accent); margin-bottom: 10px; }
.dropzone-title{ font-weight: 600; font-size: 15px; margin: 0 0 4px; }
.dropzone-sub{ color: var(--text-muted); font-size: 13px; margin: 0 0 18px; }

.file-selected{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 16px;
}
.file-selected-info{ display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon{ width: 26px; height: 26px; color: var(--accent); flex-shrink: 0; }
.file-name{ margin: 0; font-weight: 600; font-size: 13.5px; word-break: break-all; }
.file-meta{ margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

.upload-error{
  color: var(--error);
  background: var(--error-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 14px;
}

.fila-arquivos{ margin-top: 16px; }
.fila-titulo{
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 8px;
}
.fila-arquivos-lista{ display: flex; flex-direction: column; gap: 8px; }
.fila-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.fila-item-info{ display: flex; align-items: center; gap: 10px; min-width: 0; }
.fila-item-name{ font-weight: 600; font-size: 13px; word-break: break-all; }
.fila-item-meta{ font-size: 11.5px; color: var(--text-muted); }
.fila-item-status{ font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }
.fila-item-status--pendente{ background: var(--accent-soft); color: var(--accent); }
.fila-item-status--processando{ background: #21305a1a; color: var(--accent); }
.fila-item-status--ok{ background: var(--ok-soft); color: var(--ok); }
.fila-item-status--erro{ background: var(--error-soft); color: var(--error); }

/* ============================== BUTTONS ============================== */

.btn{
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, opacity 0.15s ease, background 0.15s ease;
}
.btn:active{ transform: scale(0.98); }
.btn:disabled{ opacity: 0.45; cursor: not-allowed; }

.btn-primary{
  background: var(--accent);
  color: #fff;
  width: 100%;
  margin-top: 18px;
}
.btn-primary:hover:not(:disabled){ background: var(--accent-dark); }

.btn-secondary{
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover{ border-color: var(--accent); color: var(--accent); }

.btn-sm{ padding: 7px 12px; font-size: 12.5px; }

.btn-icon-text{
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  flex-shrink: 0;
}
.btn-icon-text:hover{ color: var(--error); }

.btn-icon{
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-icon:hover{ border-color: var(--accent); color: var(--accent); }

/* ============================== PROGRESS ============================== */

.progress-card{ max-width: 680px; }

.progress-steps{
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.progress-steps li{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  font-size: 13.5px;
  color: var(--text-muted);
}
.progress-steps li .dot{
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.progress-steps li.done{ color: var(--text-primary); }
.progress-steps li.done .dot{ background: var(--ok); border-color: var(--ok); color: #fff; }
.progress-steps li.active{ color: var(--accent); font-weight: 600; }
.progress-steps li.active .dot{ border-color: var(--accent); }
.progress-steps li.active .dot::after{
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1s infinite ease-in-out;
}
.progress-steps li.error .dot{ background: var(--error); border-color: var(--error); color: #fff; }
.progress-steps li.error{ color: var(--error); font-weight: 600; }

@keyframes pulse{ 0%, 100%{ opacity: 1; } 50%{ opacity: 0.35; } }

/* ============================== RESULT SUMMARY ============================== */

.result-summary{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  max-width: 900px;
  box-shadow: var(--shadow-sm);
}

.result-summary .rs-title{
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0 0 4px;
}
.result-summary h2{ margin: 0 0 18px; font-size: 21px; }

.rs-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.rs-metric-label{ font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.rs-metric-value{ font-size: 18px; font-weight: 700; font-family: var(--font-mono); }
.rs-metric-value.positive{ color: var(--ok); }
.rs-metric-value.negative{ color: var(--error); }

.rs-badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}
.rs-badge--ok{ background: var(--ok-soft); color: var(--ok); }
.rs-badge--warn{ background: var(--warn-soft); color: var(--warn); }
.rs-badge--error{ background: var(--error-soft); color: var(--error); }

.rs-actions{ display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.rs-actions .btn{ width: auto; margin: 0; }

/* ============================== EMPTY STATES ============================== */

.empty-state{
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 640px;
}
.empty-state-inline{ color: var(--text-muted); font-size: 13.5px; padding: 6px 0 0; }

/* ============================== DADOS EXTRAIDOS ============================== */

.data-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.data-panel h3{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}

.field-row{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.field-row:last-child{ border-bottom: none; }
.field-label{ color: var(--text-secondary); }
.field-value{ font-weight: 600; text-align: right; font-family: var(--font-mono); font-size: 13px; }
.field-value.is-null{ color: var(--text-muted); font-weight: 400; font-family: var(--font-sans); font-style: italic; }

.report-table{ width: 100%; }
.report-table td{
  padding: 9px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: top;
}
.report-table tr:last-child td{ border-bottom: none; }
.report-label{ color: var(--text-secondary); width: 42%; white-space: nowrap; }
.report-value{ font-weight: 600; font-family: var(--font-mono); font-size: 13px; text-align: left; }
.report-value.is-null{ color: var(--text-muted); font-weight: 400; font-family: var(--font-sans); font-style: italic; }

.doc-header-card{ max-width: 900px; }

.sistema-manual-nota{
  font-size: 12.5px;
  color: var(--text-muted);
  margin: -8px 0 20px;
  max-width: 900px;
}

.sistema-manual-cta{ max-width: 900px; }
.sistema-manual-cta p{ margin: 8px 0 14px; color: var(--text-secondary); font-size: 13.5px; line-height: 1.5; }

.sistema-manual-form{ max-width: 900px; }
.sistema-manual-form p{ color: var(--text-secondary); font-size: 13px; line-height: 1.5; margin: 6px 0 18px; }
.form-row{ display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.form-row label{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 1;
  min-width: 150px;
}
.form-row input, .form-row select{
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: #fff;
}
.form-row input:focus, .form-row select:focus{ outline: none; border-color: var(--accent); }
.form-actions{ display: flex; gap: 10px; flex-wrap: wrap; }

.sugestao-ia-box{
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
}
.sugestao-ia-box em{ color: var(--text-secondary); font-style: italic; }

.tag-sugestao-ia{
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}



.evidence-list{ margin-top: 24px; }
.evidence-item{
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.evidence-item-head{ display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.evidence-vertex{ font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.evidence-confidence{ font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.evidence-text{ font-size: 13px; color: var(--text-secondary); font-style: italic; line-height: 1.5; }

.confidence-high{ background: var(--ok-soft); color: var(--ok); }
.confidence-medium{ background: var(--warn-soft); color: var(--warn); }
.confidence-low{ background: var(--error-soft); color: var(--error); }

/* ============================== MAP ============================== */

.map-card{ padding: 16px; }

.map-toolbar{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}
.map-toolbar-group{ display: flex; gap: 8px; }

.chip{
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.chip--active{ background: var(--accent); color: #fff; border-color: var(--accent); }

.map{
  width: 100%;
  height: 460px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.leaflet-popup-content{ font-family: var(--font-sans); font-size: 12.5px; }
.leaflet-popup-content b{ font-family: var(--font-mono); }

.mono{ font-family: var(--font-mono); font-weight: 700; }

.vertex-label{
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: none;
}
.vertex-label::before{ display: none; }

.table-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.table-scroll{ overflow-x: auto; }

.data-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th{
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
.data-table td{
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td{ border-bottom: none; }

.data-table input{
  width: 100%;
  min-width: 88px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 5px 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-primary);
}
.data-table input:hover{ border-color: var(--border-strong); }
.data-table input:focus{
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
}

.origem-tag{
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  white-space: nowrap;
}
.origem-EXTRAIDO{ background: var(--accent-soft); color: var(--accent); }
.origem-EDITADO{ background: var(--warn-soft); color: var(--warn); }
.origem-CALCULADO{ background: var(--teal-soft); color: var(--teal); }

.confidence-cell{ font-family: var(--font-mono); font-weight: 700; }

.row-delete{
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
}
.row-delete:hover{ color: var(--error); }

/* ============================== VALIDACAO ============================== */

.validation-list{ display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.validation-item{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.5;
}
.validation-item .v-icon{
  width: 22px; height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
}
.validation-item--ok{ background: var(--ok-soft); }
.validation-item--ok .v-icon{ background: var(--ok); }
.validation-item--atencao{ background: var(--warn-soft); }
.validation-item--atencao .v-icon{ background: var(--warn); }
.validation-item--erro{ background: var(--error-soft); }
.validation-item--erro .v-icon{ background: var(--error); }

/* ============================== EXPORT ============================== */

.export-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 900px;
}
.export-btn{
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.export-btn:hover{ border-color: var(--accent); }
.export-btn:active{ transform: scale(0.99); }
.export-btn-title{ font-weight: 700; font-size: 15px; }
.export-btn-sub{ font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

.export-section-title{
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 12px;
}
.export-section-title:first-child{ margin-top: 0; }

/* ============================== SELETOR DE DOCUMENTO (pills) ============================== */

.doc-selector{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.doc-pill{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  background: #fff;
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 7px 13px 7px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.doc-pill:hover{ border-color: var(--accent); }
.doc-pill.active{ background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }
.doc-pill.inativa{ text-decoration: line-through; opacity: 0.65; }

.color-dot{
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.substituicao-banner{
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--warn-soft);
  color: #7a4d0f;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
  max-width: 900px;
}

/* ============================== MAPA: LEGENDA ============================== */

.mapa-legenda{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding: 0 4px;
}
.legenda-item{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px 6px 9px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}
.legenda-item.oculta{ opacity: 0.45; }
.legenda-item.oculta .color-dot{ background: var(--text-muted) !important; }

/* ============================== PROJETOS ============================== */

.citadas-sub{ color: var(--text-secondary); font-size: 13px; margin: -4px 0 16px; max-width: 700px; }

.proj-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.proj-row:last-child{ border-bottom: none; }
.proj-row-info{ display: flex; align-items: center; gap: 10px; min-width: 0; }
.proj-row-name{ font-weight: 700; font-size: 13.5px; }
.proj-row-meta{ font-size: 12px; color: var(--text-muted); }
.proj-row-actions{ display: flex; gap: 14px; flex-shrink: 0; }
.proj-row.is-active{ background: var(--accent-soft); border-radius: var(--radius-sm); }

/* ============================== RESPONSIVE ============================== */

@media (max-width: 900px){
  .app-shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    padding: 14px 16px;
  }
  .brand{ border-bottom: none; padding: 0 16px 0 0; margin: 0; border-right: 1px solid var(--sidebar-border); }
  .nav{ flex-direction: row; }
  .sidebar-footer{ display: none; }
  .main{ padding: 28px 20px 60px; }
}

/* ============================================================================
   AUTENTICACAO (tela de login/cadastro)
   ============================================================================ */
.auth-gate{
  position: fixed;
  inset: 0;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.auth-gate[hidden]{ display: none; }
.auth-card{
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: var(--radius-lg, 16px);
  padding: 32px 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.auth-brand{ display: flex; align-items: center; gap: 10px; margin-bottom: 24px; justify-content: center; }
.auth-brand-name{ font-size: 18px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.01em; }

.auth-tabs{ display: flex; background: #f1f2f6; border-radius: 999px; padding: 3px; margin-bottom: 20px; }
.auth-tab{
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.auth-tab.active{ background: #fff; color: var(--text-primary); box-shadow: 0 1px 3px rgba(0,0,0,0.12); }

.auth-error{
  background: var(--error-soft);
  color: var(--error);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.auth-form{ display: flex; flex-direction: column; gap: 14px; }
.auth-field{ display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.auth-field input{
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
}
.auth-field input:focus{ outline: none; border-color: var(--accent); }
.auth-form .btn{ margin-top: 4px; width: 100%; }

.auth-divider{ display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--text-muted); font-size: 11.5px; }
.auth-divider::before, .auth-divider::after{ content: ""; flex: 1; height: 1px; background: var(--border); }

.auth-google-btn{ display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }

.turnstile-wrap{ display: flex; justify-content: center; min-height: 0; }

.auth-footnote{ margin-top: 18px; font-size: 11px; line-height: 1.5; color: var(--text-muted); text-align: center; }

/* ============================================================================
   INDICADOR DE USO (sidebar)
   ============================================================================ */
.usage-indicator{
  background: var(--sidebar-bg-elevated);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.usage-indicator-top{ display: flex; align-items: center; justify-content: space-between; }
.usage-indicator-top span{ font-size: 12px; font-weight: 700; color: #fff; }
.usage-logout{
  background: transparent;
  border: none;
  color: #8890a6;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 6px;
}
.usage-logout:hover{ color: #fff; }
.usage-bar{ height: 6px; background: #1d2438; border-radius: 999px; overflow: hidden; }
.usage-bar-fill{ height: 100%; background: linear-gradient(90deg, var(--accent), #8fb4ff); border-radius: 999px; transition: width 0.3s; }
.usage-text{ font-size: 11px; color: #8890a6; }

/* ============================================================================
   CARDS DE PLANOS (Minha conta)
   ============================================================================ */
.planos-grid{ display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-top: 18px; }
.plano-card{
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.plano-card--destaque{ border-color: var(--accent); box-shadow: 0 4px 20px rgba(29,78,216,0.12); }
.plano-badge{
  position: absolute;
  top: -11px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.plano-card h4{ font-size: 15px; margin: 4px 0 0; }
.plano-preco{ font-size: 26px; font-weight: 800; color: var(--text-primary); }
.plano-preco span{ font-size: 13px; font-weight: 500; color: var(--text-muted); }
.plano-limite{ font-size: 12.5px; color: var(--text-secondary); margin-bottom: 6px; }
.plano-card .btn{ width: 100%; }

.auth-error-action{
  background: none;
  border: none;
  color: var(--error);
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.doc-cor-picker{
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1.5px var(--border-strong);
  overflow: hidden;
  appearance: none;
  -webkit-appearance: none;
}
.doc-cor-picker::-webkit-color-swatch-wrapper{ padding: 0; }
.doc-cor-picker::-webkit-color-swatch{ border: none; border-radius: 50%; }
.doc-cor-picker::-moz-color-swatch{ border: none; border-radius: 50%; }

.campos-cadastro{ display: flex; flex-direction: column; gap: 14px; }
.campos-cadastro[hidden]{ display: none; }

.auth-checkbox{
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  cursor: pointer;
}
.auth-checkbox[hidden]{ display: none; }
.auth-checkbox input{ margin-top: 2px; flex-shrink: 0; }
.auth-checkbox a{ color: var(--accent); text-decoration: underline; }
