:root {
  --sidebar-bg: #111827;
  --sidebar-bg-light: #1f2937;
  --sidebar-border: rgba(255, 255, 255, 0.08);

  --body-bg: #f3f6fb;
  --card-bg: #ffffff;
  --card-border: #e6ebf2;
  --card-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);

  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  --primary: #0d6efd;
  --success: #198754;
  --warning: #f59e0b;
  --danger: #dc3545;
}

* {
  box-sizing: border-box;
}

html, body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--body-bg);
  color: var(--text-primary);
}

.btn{
    border-radius: 30px !important;
}

.btn-success{
    background-color: #D0D359 !important;
    border-radius: 30px !important;
    color: #050706 !important;
    border: none !important;
    padding: 15px 40px 15px 40px !important;
    font-size: 14px !important;
}

.btn-cancel{
    background-color: #7A7A7A !important;
    border-radius: 30px !important;
    color: #fff !important;
    border: none !important;
    padding: 15px 40px 15px 40px !important;
    font-size: 14px !important;
}

.btn-cancel:hover{
    transform: scale(1.05) !important;
}

.btn-success:hover{
    transform: scale(1.05) !important;
}

.btn-success-alt{
    background-color: #D0D359 !important;
    border-radius: 30px !important;
    color: #050706 !important;
    border: none !important;
    padding: 0.375rem !important;
    font-size: 14px !important;
}

.btn-success-alt{
    transform: scale(1.05) !important;
}

.btn-primary{
    background-color: #889B2D !important;
    border: none !important;
}

.btn-primary:hover{
    transform: scale(1.05) !important;
}

.btn-outline-primary{
    border-color: #889B2D !important;
    color: #889B2D !important;
}

.btn-outline-primary:hover{
    background-color: #889B2D !important;
    border: none !important;
    color: #fff !important;
}

.stat-success{
    border-top: 4px solid #D0D359 !important;
}

.dashboard {
  display: flex;
  min-height: 100vh;
}

.sidebar {
display: flex;
flex-direction: column;
  width: 260px;
  background: #1B2634;
  color: #fff;
  padding: 22px 18px;
  border-right: 1px solid var(--sidebar-border);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  font-size: 16px;
}

.sidebar-brand strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.sidebar-brand span {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.65);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: rgba(255,255,255,0.78);
  padding: 12px 14px;
  border-radius: 14px;
  transition: all 0.2s ease;
  font-size: 13px;
  font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
}

.sidebar-logout {
  margin-top: auto;
}

.sidebar-divider {
  margin-top: auto;
  height: 1px;
  background: rgba(255,255,255,0.2);
  width: 100%;
}

.main-content {
  flex: 1;
  min-width: 0;
}

.main-container {
  padding: 26px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.page-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.page-title p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.btn-new {
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 600;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.stat-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px 20px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-icon {
  position: absolute;
  right: 18px;
  top: 18px;
  font-size: 18px;
  opacity: 0.16;
}

.stat-primary {
  border-top: 3px solid var(--primary);
}

.stat-success {
  border-top: 3px solid var(--success);
}

.stat-warning {
  border-top: 3px solid var(--warning);
}

.content-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.content-card-header {
  padding: 20px;
  border-bottom: 1px solid #eef2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.content-card-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.filters-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters-wrap .form-control,
.filters-wrap .form-select {
  width: 170px;
  min-width: 140px;
  border-radius: 12px;
  min-height: 42px;
  font-size: 13px;
}

#filtroBusca {
  width: 220px;
}

.imoveis-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.imovel-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.imovel-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.imovel-image-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #e9eef5;
}

.imovel-link {
  position: absolute;
  top: 10px;
  right: 10px;

  width: 36px;
  height: 36px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);

  color: #333;
  font-size: 14px;

  transition: all 0.2s ease;
  text-decoration: none;
}

.imovel-link:hover {
  background: #D3D3D3;
}

.imovel-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #edf2f7;
}

.imovel-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.imovel-body {
  padding: 16px;
}

.imovel-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.imovel-location {
  color: var(--text-secondary);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
}

.imovel-price {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 14px;
}

.imovel-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.imovel-features span {
  background: #f8fafc;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.imovel-actions {
  display: flex;
  gap: 10px;
}

.imovel-actions .btn {
  flex: 1;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  min-height: 40px;
}

.pagination-wrap {
  padding: 0 20px 20px;
}

.empty-state {
  grid-column: 1 / -1;
  background: #f8fafc;
  border: 1px dashed #d8e1ec;
  border-radius: 16px;
  color: var(--text-secondary);
  text-align: center;
  padding: 40px 20px;
  font-size: 14px;
}

.offcanvas-imovel {
  width: 540px !important;
}

.offcanvas-header {
  border-bottom: 1px solid #eef2f7;
  padding: 18px 20px;
}

.offcanvas-title {
  font-size: 18px;
  font-weight: 700;
}

.offcanvas-body {
  padding: 20px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
}

.form-control,
.form-select,
textarea.form-control {
  border-radius: 12px;
  border: 1px solid #dbe4ef;
  min-height: 44px;
  font-size: 13px;
  box-shadow: none !important;
}

textarea.form-control {
  min-height: 110px;
}

.form-control:focus,
.form-select:focus {
  border-color: #b6cdfd;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 6px 0 14px;
  padding-top: 4px;
}

@media (max-width: 1199px) {
  .imoveis-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .dashboard {
    display: block;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-right: 0;
    border-bottom: 1px solid var(--sidebar-border);
  }

  .stats-row {
    grid-template-columns: 1fr;
  }

  .imoveis-grid {
    grid-template-columns: 1fr;
  }

  .offcanvas-imovel {
    width: 100% !important;
  }
}

@media (max-width: 767px) {
  .main-container {
    padding: 16px;
  }

  .content-card-header {
    padding: 16px;
  }

  .imoveis-grid {
    padding: 16px;
  }

  .pagination-wrap {
    padding: 0 16px 16px;
  }

  .filters-wrap {
    width: 100%;
  }

  .filters-wrap .form-control,
  .filters-wrap .form-select,
  #filtroBusca {
    width: 100%;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
}

.modal-xl {
  max-width: 80% !important;
}

.galeria-upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* miniatura */
.image-mini {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: #eee;
  border: 1px solid #e5e7eb;
}

/* imagem */
.image-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* botão remover */
.image-mini button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-mini button:hover {
  background: rgba(0,0,0,0.9);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 12px;
}

/* TEXTO */
.tag-chip-text {
  white-space: nowrap;
}

/* BOTÃO IGUAL AO DA GALERIA */
.tag-chip-remove {
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  border-radius: 50%;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  line-height: 1;
}

/* HOVER */
.tag-chip-remove:hover {
  background: rgba(0,0,0,0.9);
}

.form-control,
.form-select,
.form-control:focus,
.form-select:focus {
  background-color: #f3f4f6 !important;
  border-color: #e5e7eb;
  box-shadow: none;
}

#paginacao {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.pag-circle {
  width: 36px;
  height: 36px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50% !important;
  font-weight: 500;
}

.price-sufixo {
  font-size: 12px;
  opacity: 0.7;
  margin-left: 4px;
}

.content-card-title {
  font-weight: 400;
}

.content-card-title .label {
  font-weight: 700;
}

.content-card-title .valor {
  font-weight: 300;
  font-size: 0.85em;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 992px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.imovel-link-warning {
  background: #fff3cd;
  color: #856404;
}

.imovel-link-warning:hover {
  background: #ffe69c;
  color: #664d03;
}

.imovel-image-wrap {
  position: relative;
}

.duplicado-overlay {
  position: absolute;
  left: 0;
  right: 0;
  top: 40%;

  height: 90px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(220, 53, 69, 0.18);
  border: 1px solid rgba(220, 53, 69, 0.9);

  color: #dc3545;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 1px;

  z-index: 3;
  pointer-events: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.sidebar-top {
  padding-bottom: 0px;
}

.sidebar-bottom {
  margin-top: auto;
}

.sidebar-logo-top {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;
}

.sidebar-logo-top img {
    max-width: 120px;
    height: auto;
    padding-bottom: 20px;
}

.premium-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.premium-icon i {
  color: #FFD700;
  font-size: 32px;
}