/* =========================================================
   REVENUE CRM IMOBILIÁRIO - CSS PRINCIPAL
========================================================= */

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

:root {
  --bg: #F1F5F9;
  --surface: #FFF;
  --border: #E2E8F0;
  --border-2: #CBD5E1;
  --text: #1E293B;
  --muted: #64748B;
  --soft: #94A3B8;
  --primary: #0F766E;
  --primary-hover: #115E59;
  --primary-light: #CCFBF1;
  --danger: #EF4444;
  --warning: #F59E0B;
  --success: #10B981;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 4px 12px -2px rgba(15,23,42,.08);
  --shadow-lg: 0 12px 32px -8px rgba(15,23,42,.16);
}

/* BASE */

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* LOGIN */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #F1F5F9, #E0F2F1);
}

.login-box {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.login-brand h1 {
  font-size: 22px;
  font-weight: 700;
}

.login-brand p {
  font-size: 13px;
  color: var(--muted);
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), #134E4A);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  flex-shrink: 0;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form label {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  transition: .2s;
  width: 100%;
  font-family: inherit;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

.login-foot {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--soft);
}

/* BOTÕES */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: .15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

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

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  border-color: var(--border-2);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

/* HEADER */

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand .logo-mark {
  width: 36px;
  height: 36px;
  font-size: 18px;
  border-radius: 10px;
}

.header-brand strong {
  font-size: 15px;
  display: block;
  line-height: 1.1;
}

.header-brand small {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
}

.tabs-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.tabs-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
  font-family: inherit;
}

.tab-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.tab-btn.active {
  background: var(--primary-light);
  color: var(--primary);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.header-user span {
  color: var(--muted);
  font-weight: 500;
}

.btn-logout {
  padding: 6px 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: .15s;
}

.btn-logout:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* MAIN */

.app-main {
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn .25s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.panel-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.panel-head h2 {
  font-size: 22px;
  font-weight: 700;
}

.panel-head p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.panel-head > div:first-child {
  flex: 1;
  min-width: 200px;
}

.panel-head .btn-primary {
  margin-left: auto;
}

/* INDICADORES */

.stats-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  min-width: 110px;
}

.stat-card small {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .03em;
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

.stat-card strong {
  font-size: 17px;
  font-weight: 700;
}

/* PESQUISA */

.search-box {
  flex: 1;
  max-width: 340px;
  min-width: 200px;
}

.search-box input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: .2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

/* KANBAN */

.kanban-wrap {
  overflow-x: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

.kanban-board {
  display: flex;
  gap: 16px;
  min-height: calc(100vh - 260px);
}

.kanban-col {
  background: var(--bg);
  border-radius: var(--radius-lg);
  min-width: 290px;
  max-width: 290px;
  display: flex;
  flex-direction: column;
  padding: 12px;
  border: 1px solid var(--border);
  transition: .15s;
}

.kanban-col.drag-over {
  background: var(--primary-light);
  border-color: var(--primary);
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.col-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.col-name {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
}

.col-count {
  background: var(--surface);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.col-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 40px;
}

.col-add {
  padding: 10px;
  border: 1px dashed var(--border-2);
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: .15s;
  margin-top: 10px;
  font-family: inherit;
}

.col-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface);
}

/* CARDS */

.deal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: .15s;
  box-shadow: var(--shadow-sm);
}

.deal-card:hover {
  border-color: var(--border-2);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.deal-card.dragging {
  opacity: .4;
  transform: rotate(2deg);
}

.card-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  line-height: 1.3;
}

.card-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.card-value {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  margin-top: 8px;
}

.card-priority {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.priority-alta .card-priority { background: var(--danger); }
.priority-media .card-priority { background: var(--warning); }
.priority-baixa .card-priority { background: var(--soft); }

/* TABELAS */

.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  overflow-x: auto;
}

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

.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover { background: var(--bg); }

.data-table .actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.empty-row {
  text-align: center;
  padding: 40px;
  color: var(--soft);
  font-size: 14px;
}

/* BADGES */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.badge-venda { background: #DBEAFE; color: #1E40AF; }
.badge-aluguel { background: #FEF3C7; color: #92400E; }
.badge-disponivel { background: #D1FAE5; color: #065F46; }
.badge-reservado { background: #FEF3C7; color: #92400E; }
.badge-vendido { background: #FEE2E2; color: #991B1B; }
.badge-alugado { background: #E0E7FF; color: #3730A3; }

/* ATIVIDADES */

.activities-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.activity-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: .15s;
}

.activity-item.done { opacity: .55; }

.activity-item.done .act-desc {
  text-decoration: line-through;
  color: var(--muted);
}

.act-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  transition: .15s;
  background: var(--surface);
}

.act-check:hover { border-color: var(--primary); }

.activity-item.done .act-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.activity-item.done .act-check::after {
  content: '✓';
  font-size: 13px;
  font-weight: 700;
}

.act-body { flex: 1; min-width: 0; }

.act-desc {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 3px;
}

.act-meta {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.act-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg);
}

/* MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15,23,42,.5);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .2s;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .25s;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: .15s;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* FORMULÁRIOS */

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

.form-grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  transition: .2s;
  width: 100%;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

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

/* ALERTAS E TOAST */

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
  border-left: 4px solid;
}

.alert-error {
  background: #FEE2E2;
  border-color: var(--danger);
  color: #991B1B;
}

#toastContainer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: .3s;
  white-space: nowrap;
}

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

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

/* FOTOS DOS IMÓVEIS */

.prop-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: .2s;
  display: block;
}

.prop-thumb:hover {
  transform: scale(1.06);
  border-color: var(--primary);
}

.prop-thumb-empty {
  color: var(--soft);
  font-size: 13px;
}

.upload-zone {
  border: 2px dashed var(--border-2);
  border-radius: 10px;
  cursor: pointer;
  transition: .2s;
  background: var(--bg);
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-preview {
  min-height: 140px;
  display: grid;
  place-items: center;
  position: relative;
}

.upload-preview img {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.upload-change {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(15,23,42,.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.upload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.upload-empty .upload-icon {
  font-size: 32px;
  line-height: 1;
}

.upload-empty small {
  color: var(--soft);
  font-size: 11px;
}

/* MULTI-CORRETOR */

.owner-filter {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  max-width: 200px;
  color: var(--text);
  transition: .2s;
}

.owner-filter:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,118,110,.12);
}

.user-badge {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  text-align: right;
}

.user-badge strong {
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
}

.user-badge small {
  font-size: 10.5px;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.owner-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: #E0F2F1;
  color: #0F766E;
  font-size: 11px;
  font-weight: 600;
}

.owner-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #F0F9FF;
  color: #0369A1;
  font-size: 10.5px;
  font-weight: 600;
}

.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.role-admin { background: #FEF3C7; color: #92400E; }
.role-corretor { background: #DBEAFE; color: #1E40AF; }

/* WHATSAPP */

.deal-card { position: relative; }

.card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}

.wa-mini {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37,211,102,.30);
  transition: transform .2s, background .2s, box-shadow .2s;
}

.wa-mini svg {
  width: 18px;
  height: 18px;
  fill: #fff;
  display: block;
}

.wa-mini:not(.wa-unavailable):hover {
  transform: scale(1.10);
  background: #128C7E;
  box-shadow: 0 4px 12px rgba(37,211,102,.40);
}

.wa-mini:active { transform: scale(.94); }

.wa-mini.wa-unavailable {
  background: #94A3B8;
  box-shadow: none;
  filter: grayscale(1);
  cursor: not-allowed;
}

.wa-mini-table {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-left: 4px;
}

.wa-mini-table svg {
  width: 13px;
  height: 13px;
}

.wa-inline {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: #25D366;
  color: #fff;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 16px;
  transition: transform .2s, background .2s, opacity .2s;
  box-shadow: 0 2px 6px rgba(37,211,102,.25);
}

.wa-inline:hover:not(:disabled) {
  transform: scale(1.05);
  background: #128C7E;
}

.wa-inline:disabled { cursor: not-allowed; }

.field-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.field-row select {
  flex: 1;
  min-width: 0;
}

/* VISUALIZAÇÃO DAS FOTOS */

.property-image-viewer {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  background: #F1F5F9;
  border-radius: 10px;
}

.property-image-viewer img {
  display: block;
  width: 100%;
  max-width: 650px;
  max-height: 400px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

/* =========================================================
   MENU MOBILE - CAMADAS CORRIGIDAS
========================================================= */

.mobile-menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  z-index: 1300;
  transition: background .2s, border-color .2s;
}

.mobile-menu-toggle:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.mobile-menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 3px;
  background: var(--text);
  transition: transform .25s, opacity .2s;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/*
  IMPORTANTE:
  O backdrop fica ABAIXO do cabeçalho.
  O menu está dentro do cabeçalho e, por isso,
  precisa ficar acima do backdrop.
*/

.mobile-menu-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(15,23,42,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.mobile-menu-backdrop.active {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* RESPONSIVIDADE */

@media (max-width: 768px) {

  .app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;

    /*
      Cabeçalho acima do backdrop.
      Os elementos internos podem receber
      seus próprios níveis de empilhamento.
    */
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-brand {
    flex: 1;
  }

  .mobile-menu-toggle {
    display: flex;
    z-index: 1300;
  }

  .tabs-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1200;

    width: min(82vw, 320px);
    height: 100vh;
    height: 100dvh;

    padding: 85px 16px 24px;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;

    background: var(--surface);
    border-right: 1px solid var(--border);
    box-shadow: 8px 0 30px rgba(15,23,42,.12);

    overflow-y: auto;
    overscroll-behavior: contain;

    transform: translateX(-105%);
    visibility: hidden;
    pointer-events: none;

    transition: transform .28s ease, visibility .28s ease;
  }

  .tabs-nav.mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .tabs-nav .tab-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 12px 15px;
    border-radius: 9px;
    font-size: 15px;
    text-align: left;
  }

  .tabs-nav .tab-btn:hover {
    background: var(--bg);
  }

  .tabs-nav .tab-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
  }

  .header-user {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .header-user span {
    display: none;
  }

  .owner-filter {
    max-width: 190px;
    flex: 1;
    font-size: 12px;
    padding: 6px 10px;
  }

  .user-badge small { font-size: 9.5px; }
  .user-badge strong { font-size: 11px; }

  .app-main { padding: 14px; }

  .panel-head h2 { font-size: 18px; }

  .panel-head .btn-primary {
    margin-left: 0;
    width: 100%;
  }

  .stats-row { width: 100%; }

  .stat-card {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
  }

  .stat-card strong { font-size: 15px; }

  .kanban-col {
    min-width: 270px;
    max-width: 270px;
  }

  .modal { max-height: 95vh; }

  .data-table { font-size: 13px; }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .card-actions {
    top: 8px;
    right: 8px;
    gap: 5px;
  }

  .wa-mini {
    width: 30px;
    height: 30px;
  }

  .wa-mini svg {
    width: 17px;
    height: 17px;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 520px) {
  .form-grid.two {
    grid-template-columns: 1fr;
  }

  .prop-thumb {
    width: 48px;
    height: 48px;
  }

  .property-image-viewer img {
    max-height: 300px;
  }
}

@media (max-width: 380px) {
  .wa-mini {
    width: 28px;
    height: 28px;
  }

  .wa-mini svg {
    width: 16px;
    height: 16px;
  }

  .kanban-col {
    min-width: 250px;
    max-width: 250px;
  }

  .app-main {
    padding: 10px;
  }
}
