* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(135deg, #101d30, #1c3253);
  min-height: 100vh;
}

/* Login */

.login-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.card-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #f2f1ec;
  width: 100%;
  max-width: 360px;
  padding: 32px 28px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.logo {
  display: block;
  width: 140px;
  margin: 0 auto 16px;
}

.subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: #56636f;
  text-align: center;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #344054;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
}

.field input:focus {
  outline: none;
  border-color: #16283f;
  box-shadow: 0 0 0 3px rgba(22, 40, 63, 0.15);
}

.error-message {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 0 0 16px;
}

button[type="submit"] {
  width: 100%;
  padding: 11px;
  background: #16283f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

button[type="submit"]:hover {
  background: #0e1a2b;
}

button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* App shell (telas pós-login) */

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

.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: #f2f1ec;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.logo-small {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
}

.header-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.app-title {
  font-weight: 700;
  color: #16283f;
  font-size: 15px;
}

.welcome-text {
  font-size: 12px;
  color: #56636f;
}

.back-link {
  color: #16283f;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.back-link:hover {
  text-decoration: underline;
}

.btn-logout {
  padding: 8px 18px;
  background: #16283f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.btn-logout:hover {
  background: #0e1a2b;
}

/* Grade de navegação */

.nav-main {
  flex: 1;
  padding: 40px 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.page-title {
  color: #16283f;
  text-align: center;
  margin: 0 0 32px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  padding: 40px 24px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.nav-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 32px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #16283f;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.nav-card-icon {
  font-size: 36px;
}

.nav-card-title {
  font-size: 16px;
  font-weight: 600;
}

/* Páginas placeholder (Checklist, Procedimentos, Documentos) */

.placeholder-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  color: #16283f;
}

.placeholder-main p {
  color: #56636f;
  max-width: 420px;
}

/* Cadastros (Locador/Locatário/Imóvel/Contrato) */

.cadastro-main {
  flex: 1;
  padding: 32px 24px 48px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

.cadastro-main h1 {
  color: #16283f;
  margin: 0 0 20px;
}

.cadastro-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cadastro-card h2 {
  margin: 0 0 16px;
  font-size: 17px;
  color: #16283f;
}

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

.cadastro-card .field {
  margin-bottom: 0;
}

.cadastro-card .field textarea,
.cadastro-card .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
  font-family: inherit;
}

.cadastro-card .field textarea {
  min-height: 70px;
  resize: vertical;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.btn-primary {
  padding: 10px 22px;
  background: #16283f;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover {
  background: #0e1a2b;
}

.btn-secondary {
  padding: 10px 22px;
  background: #eceae3;
  color: #16283f;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #e2dfd5;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #eceae3;
}

.data-table th {
  color: #56636f;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.empty-row {
  text-align: center;
  color: #56636f;
  padding: 20px;
}

.actions-cell {
  white-space: nowrap;
}

.btn-link {
  background: none;
  border: none;
  color: #16283f;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
}

.btn-link:hover {
  text-decoration: underline;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-ativo {
  background: #ecfdf3;
  color: #067647;
}

.status-inativo {
  background: #fef3f2;
  color: #b42318;
}

.field-manager summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  color: #16283f;
}

.field-manager-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0 24px;
}

.field-manager-table th,
.field-manager-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #eceae3;
}

.field-system-tag {
  font-size: 12px;
  color: #56636f;
  font-style: italic;
}

.btn-toggle-field {
  background: none;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #16283f;
}

.btn-toggle-field:hover {
  background: #eceae3;
}

.field-add-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  align-items: end;
  border-top: 1px solid #eceae3;
  padding-top: 16px;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #344054;
}

.field-error {
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  margin: 0 0 16px;
}

/* Rodapé */

.app-footer {
  text-align: center;
  padding: 12px;
  font-size: 12px;
  color: #56636f;
}

.login-footer {
  color: rgba(255, 255, 255, 0.65);
}

/* Financeiro: status extras */

.status-pago {
  background: #ecfdf3;
  color: #067647;
}

.status-pendente {
  background: #fff6e5;
  color: #b54708;
}

.status-atrasado {
  background: #fef3f2;
  color: #b42318;
}

.status-conciliado {
  background: #eaf0ff;
  color: #1d4ed8;
}

.status-nao-conciliado {
  background: #f2f1ec;
  color: #56636f;
}

.status-receita {
  background: #ecfdf3;
  color: #067647;
}

.status-despesa {
  background: #fef3f2;
  color: #b42318;
}

/* Financeiro: filtros e resumo */

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  align-items: end;
  margin-bottom: 20px;
}

.filter-bar .field {
  margin-bottom: 0;
}

.filter-bar select,
.filter-bar input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  font-size: 14px;
  background: #ffffff;
  font-family: inherit;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.summary-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.summary-card-label {
  font-size: 12px;
  color: #56636f;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}

.summary-card-value {
  font-size: 22px;
  font-weight: 700;
  color: #16283f;
  margin: 0;
}

.summary-card-value.positivo {
  color: #067647;
}

.summary-card-value.negativo {
  color: #b42318;
}

.text-right {
  text-align: right;
}

.report-section-title {
  color: #16283f;
  font-size: 15px;
  margin: 24px 0 12px;
}

/* Financeiro: conciliação */

.match-suggestion {
  background: #f2f1ec;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-top: 6px;
}

.item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.upload-dropzone {
  border: 2px dashed #d0d5dd;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  color: #56636f;
  font-size: 13px;
}

.hint-text {
  font-size: 12px;
  color: #56636f;
  margin: 4px 0 0;
}

.conciliacao-item {
  background: #ffffff;
  border: 1px solid #eceae3;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
}

.conciliacao-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.conciliacao-item-info {
  font-size: 14px;
  color: #344054;
}

.conciliacao-item-info strong {
  color: #16283f;
}

.conciliacao-item-valor {
  font-size: 16px;
  font-weight: 700;
}

.conciliacao-manual {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  border-top: 1px solid #eceae3;
  padding-top: 10px;
}

.csv-mapping-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px 20px;
  margin-top: 16px;
  border-top: 1px solid #eceae3;
  padding-top: 16px;
}

.import-result {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.import-result.ok {
  background: #ecfdf3;
  color: #067647;
}

.import-result.erro {
  background: #fef3f2;
  color: #b42318;
}

/* Contratos Contábeis: Minuta de Contrato */

.field-hint {
  font-size: 13px;
  color: #56636f;
  margin: 0 0 16px;
}

.minuta-preview .clausula-bloco {
  margin-bottom: 20px;
}

.minuta-preview input.clausula-titulo {
  width: 100%;
  font-weight: 700;
  font-size: 15px;
  color: #16283f;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-family: inherit;
}

.minuta-preview textarea.clausula-texto {
  width: 100%;
  min-height: 120px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.placeholders-cheatsheet {
  background: #f5f4f0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
}

.placeholder-grupo {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.placeholder-grupo strong {
  text-transform: capitalize;
  min-width: 90px;
}

.clausulas-table textarea.clausula-edit-conteudo {
  width: 100%;
  min-height: 80px;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
}

.clausulas-table input.clausula-edit-titulo {
  width: 100%;
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  margin-bottom: 4px;
}

@media print {
  body.print-mode .app-header,
  body.print-mode .app-footer,
  body.print-mode h1,
  body.print-mode #minuta-contrato-field,
  body.print-mode .form-actions,
  body.print-mode .field-error,
  body.print-mode .field-hint {
    display: none !important;
  }

  body.print-mode .minuta-preview input.clausula-titulo,
  body.print-mode .minuta-preview textarea.clausula-texto {
    border: none;
    padding: 0;
    resize: none;
  }

  body.print-mode .minuta-preview textarea.clausula-texto {
    height: auto;
  }
}

/* Lançamentos Bancários */

.valor-positivo,
.conciliacao-item-valor.positivo {
  color: #067647;
}

.valor-negativo,
.conciliacao-item-valor.negativo {
  color: #b42318;
}

.natureza-resumo {
  max-width: 560px;
  margin-bottom: 20px;
}

.natureza-table th:first-child {
  width: 60%;
}

.tag-sugestao {
  display: inline-block;
  background: #fef0c7;
  color: #93370d;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.lote-bancario {
  background: #fffaeb;
  border: 1px solid #fedf89;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.lote-bancario .data-table select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

/* Login: esqueci minha senha / código de recuperação */

.login-link {
  display: block;
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: #1c3253;
}

.recovery-code-box {
  background: #f2f1ec;
  border: 1px dashed #56636f;
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
  text-align: center;
}

.recovery-code-box code {
  display: block;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #16283f;
  margin: 6px 0;
}

.success-message {
  background: #ecfdf3;
  color: #067647;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 0 0 16px;
}

/* Conciliação: pré-visualização da importação */

.preview-box {
  margin-top: 18px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  padding: 16px;
  background: #fcfcfd;
  font-size: 14px;
  color: #344054;
}

.preview-box h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #16283f;
}

.preview-cards {
  margin: 12px 0;
}

.preview-cards .summary-card {
  padding: 12px 14px;
}

.preview-cards .summary-card-value {
  font-size: 18px;
}

.preview-table {
  max-height: 420px;
  overflow-y: auto;
  margin-top: 10px;
}

.linha-duplicada td {
  color: #98a2b3;
  text-decoration: line-through;
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

.data-table td.text-right {
  white-space: nowrap;
}

/* Regras de classificação */

.tag-regra {
  display: inline-block;
  background: #e0eaff;
  color: #1c3a8a;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}

.tag-regra.tag-auto {
  background: #d1fadf;
  color: #05603a;
}

.acao-sugerida {
  background: #f5f8ff;
  border-radius: 8px;
  padding-left: 8px;
  padding-right: 8px;
}

.item-rodape {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid #eceae3;
  padding-top: 10px;
}

.linha-inativa td {
  color: #98a2b3;
}

.lote-bancario .data-table select + select {
  margin-top: 4px;
}

/* Integrações com bancos (API) */

.passo-a-passo {
  margin: 0 0 8px;
  padding-left: 20px;
  font-size: 14px;
  color: #344054;
  line-height: 1.6;
}

.integracao-rapida {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid #eceae3;
  font-size: 14px;
}

.integracao-rapida:first-child {
  border-top: none;
}

.integracao-rapida small {
  display: block;
}
