/* ===== M3G Imobiliária — Design System ===== */
:root {
  --navy: #1a2235;
  --navy-light: #243047;
  --navy-dark: #111827;
  --gold: #b8944a;
  --gold-light: #d4b06e;
  --gold-dark: #8a6d35;
  --gold-subtle: rgba(184,148,74,0.08);
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 64px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', sans-serif;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e5e8ed;
  --text: #1a2235;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  transition: width 0.3s ease;
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-logo {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--header-height);
}
.sidebar-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: #fff;
  line-height: 1;
  white-space: nowrap;
}
.sidebar-logo-text small {
  display: block;
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: var(--gold);
  font-family: var(--font-body);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
  scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  padding: 0.75rem 1.25rem 0.4rem;
  white-space: nowrap;
}
.sidebar.collapsed .nav-section-label { opacity: 0; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  position: relative;
  border-radius: 0;
}
.nav-item:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.nav-item.active {
  color: #fff;
  background: rgba(184,148,74,0.15);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
  border-radius: 0 2px 2px 0;
}
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-badge {
  margin-left: auto;
  background: var(--gold);
  color: var(--navy);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sidebar-avatar {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--navy);
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 500; color: #fff; }
.sidebar-user-role { font-size: 0.73rem; color: rgba(255,255,255,0.45); }

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

/* ===== TOP BAR ===== */
.topbar {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-toggle {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
}
.topbar-toggle:hover { background: var(--bg); }
.topbar-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-muted);
  border-radius: 1px;
  transition: all 0.3s;
}
.topbar-breadcrumb {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}
.topbar-breadcrumb strong { color: var(--text); font-weight: 600; }
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.topbar-search {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  gap: 0.5rem;
  width: 240px;
  transition: border-color 0.2s;
}
.topbar-search:focus-within { border-color: var(--gold); }
.topbar-search input {
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text);
  width: 100%;
}
.topbar-btn {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s;
  position: relative;
}
.topbar-btn:hover { border-color: var(--gold); color: var(--gold); }
.topbar-btn .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 0.6rem;
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: 8px;
  transition: background 0.15s;
}
.topbar-user:hover { background: var(--bg); }
.topbar-avatar {
  width: 34px;
  height: 34px;
  background: var(--navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--gold);
}
.topbar-user-name { font-size: 0.85rem; font-weight: 500; }
.topbar-user-role { font-size: 0.73rem; color: var(--text-muted); }

/* ===== PAGE CONTENT ===== */
.page-content {
  flex: 1;
  padding: 1.75rem 2rem;
}
@media (max-width: 768px) {
  .page-content { padding: 1rem; }
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.1;
}
.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.page-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #fafafa;
}

/* ===== STAT CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.3s;
  transform-origin: left;
}
.stat-card:hover::after { transform: scaleX(1); }
.stat-card-info {}
.stat-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.stat-card-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-card-change {
  font-size: 0.78rem;
  margin-top: 0.4rem;
  font-weight: 500;
}
.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }
.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card-icon.gold { background: rgba(184,148,74,0.12); color: var(--gold); }
.stat-card-icon.navy { background: rgba(26,34,53,0.08); color: var(--navy); }
.stat-card-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-card-icon.blue { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-card-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--navy); background: var(--bg); }
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1rem; }
.btn-icon { padding: 0.55rem; }

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  background: #fafafa;
  white-space: nowrap;
}
td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(184,148,74,0.04); }
.td-primary { font-weight: 600; color: var(--navy); }
.td-muted { color: var(--text-muted); font-size: 0.82rem; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-success { background: rgba(16,185,129,0.12); color: #059669; }
.badge-warning { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-danger { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-info { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-gold { background: rgba(184,148,74,0.15); color: var(--gold-dark); }
.badge-navy { background: rgba(26,34,53,0.1); color: var(--navy); }
.badge-gray { background: #f3f4f6; color: #6b7280; }

/* ===== FORMS ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full { grid-column: 1 / -1; }
@media (max-width: 600px) {
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}
.form-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.45rem;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,148,74,0.12); }
.form-field textarea { resize: vertical; min-height: 100px; }
.form-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 0.35rem; }

/* ===== FILTERS BAR ===== */
.filters-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.filter-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.filter-group select, .filter-group input {
  padding: 0.45rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
  background: var(--bg);
  color: var(--text);
}
.filter-group select:focus, .filter-group input:focus { border-color: var(--gold); }
.filter-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
}
.filter-search input {
  border: none;
  background: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  width: 100%;
}
.filter-search:focus-within { border-color: var(--gold); }

/* ===== IMOVEL CARD (Grid View) ===== */
.imoveis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.imovel-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.imovel-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.imovel-card-img {
  height: 200px;
  background: linear-gradient(135deg, var(--navy) 0%, #2d3f5e 100%);
  position: relative;
  overflow: hidden;
}
.imovel-card-img img { width: 100%; height: 100%; object-fit: cover; }
.imovel-card-img-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 3rem;
}
.imovel-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
}
.imovel-card-fav {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.imovel-card-body { padding: 1.1rem 1.25rem; }
.imovel-card-tipo { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); margin-bottom: 0.3rem; }
.imovel-card-nome { font-weight: 600; font-size: 0.95rem; color: var(--navy); margin-bottom: 0.3rem; line-height: 1.3; }
.imovel-card-end { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.3rem; }
.imovel-card-specs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.imovel-spec { display: flex; align-items: center; gap: 0.3rem; font-size: 0.8rem; color: var(--text-muted); }
.imovel-spec svg { width: 14px; height: 14px; }
.imovel-card-footer { display: flex; align-items: center; justify-content: space-between; }
.imovel-card-preco { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--navy); }
.imovel-card-preco small { font-size: 0.7rem; color: var(--text-muted); font-family: var(--font-body); font-weight: 400; display: block; }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.show .modal { transform: translateY(0); }
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-title { font-family: var(--font-display); font-size: 1.4rem; font-weight: 600; color: var(--navy); }
.modal-close { width: 32px; height: 32px; border: none; background: var(--bg); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--text-muted); transition: all 0.15s; }
.modal-close:hover { background: var(--danger); color: #fff; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1.25rem 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 0.75rem; justify-content: flex-end; }

/* ===== TABS ===== */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; gap: 0; }
.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }

/* ===== TIMELINE ===== */
.timeline { position: relative; }
.timeline-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border: 2px solid var(--border);
  background: var(--surface);
  z-index: 1;
}
.timeline-content { flex: 1; padding-top: 0.5rem; }
.timeline-title { font-size: 0.88rem; font-weight: 600; color: var(--navy); }
.timeline-time { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ===== CHART PLACEHOLDERS ===== */
.chart-container { position: relative; height: 260px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  text-align: center;
}
.empty-state-icon { font-size: 3rem; color: var(--text-light); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1rem; font-weight: 600; color: var(--text); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; color: var(--text-muted); max-width: 280px; }

/* ===== ALERTS ===== */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.alert-success { background: rgba(16,185,129,0.08); border-color: var(--success); color: #065f46; }
.alert-warning { background: rgba(245,158,11,0.08); border-color: var(--warning); color: #92400e; }
.alert-danger { background: rgba(239,68,68,0.08); border-color: var(--danger); color: #991b1b; }
.alert-info { background: rgba(59,130,246,0.08); border-color: var(--info); color: #1e40af; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  border-left: 4px solid var(--gold);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}
.pagination-info { font-size: 0.82rem; color: var(--text-muted); }
.pagination-controls { display: flex; gap: 0.35rem; }
.page-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  border-radius: 6px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  color: var(--text-muted);
  transition: all 0.15s;
}
.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .topbar-search { width: 180px; }
}
@media (max-width: 768px) {
  .sidebar { width: 0; overflow: hidden; }
  .sidebar.mobile-open { width: var(--sidebar-width); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .imoveis-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .topbar-search { display: none; }
}

/* ===== UTILS ===== */
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.text-navy { color: var(--navy); }
.fw-600 { font-weight: 600; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.scrollbar-thin { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }

/* ===== AVATAR GROUP ===== */
.avatar-group { display: flex; }
.avatar-group .avatar { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; font-size: 0.7rem; margin-left: -8px; background: var(--navy); color: var(--gold); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ===== KANBAN ===== */
.kanban-board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.kanban-col { min-width: 260px; flex-shrink: 0; }
.kanban-col-header { padding: 0.75rem 1rem; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 1rem; margin-bottom: 0.65rem; cursor: grab; transition: box-shadow 0.15s; }
.kanban-card:hover { box-shadow: var(--shadow-md); }
.kanban-card-title { font-size: 0.875rem; font-weight: 600; color: var(--navy); margin-bottom: 0.4rem; }
.kanban-card-meta { font-size: 0.75rem; color: var(--text-muted); }

/* ===== DROPDOWN ===== */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  z-index: 200;
  display: none;
  overflow: hidden;
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--bg); }
.dropdown-divider { height: 1px; background: var(--border); margin: 0.35rem 0; }

/* ===== COMPATIBILITY ALIASES (new pages) ===== */

/* Form aliases */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--navy);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,148,74,0.12);
}
.form-control[type="date"] { cursor: pointer; }
select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}
textarea.form-control { resize: vertical; min-height: 90px; }

/* Stat card aliases */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card { display: flex; align-items: center; gap: 1rem; }
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-body { flex: 1; }
.stat-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}
.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Table toolbar alias */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

/* Badge size */
.badge-default { background: #f3f4f6; color: #6b7280; }

