/* =============================================
   M2 IMOBILIÁRIA — PAINEL DO CORRETOR
   ============================================= */

.painel-page {
  min-height: 100vh;
  background: var(--white-soft);
  display: flex;
}

/* --- Sidebar --- */
.painel-sidebar {
  width: 260px;
  background: var(--white);
  border-right: 1px solid var(--white-muted);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-base);
}

.painel-logo-area {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  border-bottom: 1px solid var(--white-muted);
}

.painel-nav {
  padding: var(--space-6) 0;
  flex: 1;
  overflow-y: auto;
}

.painel-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-6);
  color: var(--gray-dark);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
  border-left: 3px solid transparent;
}

.painel-nav-item:hover,
.painel-nav-item.active {
  background: rgba(201,168,76,0.05);
  color: var(--gold);
  border-left-color: var(--gold);
}

.painel-user {
  padding: var(--space-6);
  border-top: 1px solid var(--white-muted);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: var(--font-display);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--black);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.user-role {
  font-size: var(--text-xs);
  color: var(--gray-mid);
}

.logout-btn {
  color: var(--gray-mid);
  cursor: pointer;
  transition: color var(--transition-fast);
}
.logout-btn:hover { color: #ef4444; }

/* --- Main Content --- */
.painel-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.painel-header {
  height: var(--navbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--white-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  position: sticky;
  top: 0;
  z-index: 90;
}

.painel-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--black);
}

.painel-content {
  padding: var(--space-8);
  flex: 1;
  overflow-y: auto;
}

/* --- Dashboard / List --- */
.painel-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
  gap: var(--space-4);
}

.search-imovel {
  display: flex;
  align-items: center;
  background: var(--white-soft);
  border: 1px solid var(--white-muted);
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  width: 300px;
}
.search-imovel input {
  flex: 1;
  background: transparent;
  border: none;
  padding: var(--space-2);
  color: var(--black);
  font-size: var(--text-sm);
  outline: none;
}

/* Table */
.table-container {
  background: var(--white);
  border: 1px solid var(--white-muted);
  border-radius: var(--radius-xl);
  overflow-x: auto;
}

.painel-table {
  width: 100%;
  border-collapse: collapse;
}

.painel-table th {
  text-align: left;
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--white-muted);
}

.painel-table td {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--white-muted);
  font-size: var(--text-sm);
  color: var(--gray-dark);
  vertical-align: middle;
}

.painel-table tr:last-child td { border-bottom: none; }
.painel-table tr:hover { background: rgba(0,0,0,0.02); }

.td-imovel {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 250px;
}

.td-img {
  width: 60px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.td-title {
  color: var(--black);
  font-weight: 500;
  display: block;
  margin-bottom: 2px;
}

.td-ref {
  font-size: var(--text-xs);
  color: var(--gray-mid);
  font-family: monospace;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}
.status-ativo { background: rgba(16,185,129,0.1); color: #34d399; border: 1px solid rgba(16,185,129,0.2); }
.status-inativo { background: rgba(239,68,68,0.1); color: #f87171; border: 1px solid rgba(239,68,68,0.2); }

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-mid);
  transition: all var(--transition-fast);
  background: var(--white-soft);
  border: 1px solid var(--white-muted);
}
.action-btn:hover {
  color: var(--black);
  border-color: var(--gray-dark);
  background: var(--white-muted);
}
.action-btn.delete:hover {
  color: #f87171;
  border-color: #f87171;
  background: rgba(239,68,68,0.1);
}

/* --- Form --- */
.painel-form-card {
  background: var(--white);
  border: 1px solid var(--white-muted);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 900px;
  margin: 0 auto;
}

.form-section-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--black);
  margin-bottom: var(--space-5);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--white-muted);
}

.form-section-title span { color: var(--gold); }

/* --- Upload Area --- */
.upload-area {
  border: 2px dashed var(--white-muted);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
  background: rgba(0,0,0,0.01);
}
.upload-area:hover, .upload-area.dragover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.05);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.photo-preview {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--white-muted);
}
.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: rgba(0,0,0,0.7);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-capa-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gold);
  color: var(--black);
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  padding: 2px;
}

/* --- Switches / Checkboxes --- */
.switch-label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}
.switch-text {
  font-size: var(--text-sm);
  color: var(--gray-light);
}
.switch-track {
  width: 44px;
  height: 24px;
  background: var(--gray-pale);
  border-radius: 12px;
  position: relative;
  transition: all var(--transition-fast);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}
.switch-thumb {
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  left: 3px;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
input[type="checkbox"]:checked + .switch-track {
  background: var(--gold);
}
input[type="checkbox"]:checked + .switch-track .switch-thumb {
  left: 23px;
  background: var(--white);
}

/* Mobile Painel */
@media (max-width: 1024px) {
  .painel-sidebar {
    transform: translateX(-100%);
  }
  .painel-sidebar.open {
    transform: translateX(0);
  }
  .painel-main {
    margin-left: 0;
  }
  .mobile-menu-btn {
    display: block !important;
  }
}
