/* ==========================================================================
   SISTEMA DE DESIGN & VARIÁVEIS CSS
   ========================================================================== */
:root {
  /* Paleta de Cores - Premium Dark Mode */
  --bg-primary: #0a0b10;
  --bg-secondary: #121420;
  --bg-tertiary: #1b1e32;
  --bg-glass: rgba(18, 20, 32, 0.7);
  --bg-glass-accent: rgba(27, 30, 50, 0.85);
  
  --accent-color: #6366f1; /* Indigo */
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --accent-glow: rgba(99, 102, 241, 0.45);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Cores de Status */
  --status-ready-bg: rgba(16, 185, 129, 0.15);
  --status-ready-text: #34d399;
  --status-ready-border: rgba(16, 185, 129, 0.3);
  
  --status-pending-bg: rgba(245, 158, 11, 0.15);
  --status-pending-text: #fbbf24;
  --status-pending-border: rgba(245, 158, 11, 0.3);
  
  --status-maintenance-bg: rgba(239, 68, 68, 0.15);
  --status-maintenance-text: #f87171;
  --status-maintenance-border: rgba(239, 68, 68, 0.3);

  /* Elementos Visuais */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 24px;
  --box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-family: 'Inter', sans-serif;
  --font-title: 'Outfit', sans-serif;
}

/* ==========================================================================
   RESET E CONFIGURAÇÕES GERAIS
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbars Personalizados para Webkit */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

/* ==========================================================================
   LAYOUT PRINCIPAL (APP CONTAINER)
   ========================================================================== */
.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
}

/* BARRA LATERAL (SIDEBAR) */
.sidebar {
  width: 260px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px;
  flex-shrink: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}

.logo i {
  font-size: 24px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo span {
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: var(--transition-smooth);
}

.nav-item:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--accent-gradient);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.nav-item i {
  font-size: 18px;
}

.sidebar-footer {
  margin-top: auto;
}

.location-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
}

.location-badge i {
  color: var(--accent-color);
}

/* ÁREA DE CONTEÚDO PRINCIPAL */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* CABEÇALHO SUPERIOR */
.main-header {
  height: 70px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}

.search-container {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  padding: 8px 20px;
  width: 380px;
  transition: var(--transition-smooth);
}

.search-container:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-container i {
  color: var(--text-muted);
}

.search-container input {
  width: 100%;
  font-size: 14px;
}

.search-container input::placeholder {
  color: var(--text-muted);
}

.stats-header {
  display: flex;
  gap: 16px;
}

.stat-bubble {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 16px;
  border-radius: var(--border-radius-sm);
  min-width: 100px;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 700;
}

.stat-bubble.status-ready {
  border-left: 3px solid var(--status-ready-text);
}
.stat-bubble.status-ready .stat-value {
  color: var(--status-ready-text);
}

.stat-bubble.status-pending {
  border-left: 3px solid var(--status-pending-text);
}
.stat-bubble.status-pending .stat-value {
  color: var(--status-pending-text);
}

/* ENVELOPE DAS SEÇÕES DE CONTEÚDO */
.content-wrapper {
  flex-grow: 1;
  overflow-y: auto;
  position: relative;
  padding: 32px;
}

.content-section {
  display: none;
  animation: fadeIn 0.4s ease-out;
  height: 100%;
}

.content-section.active {
  display: flex;
  flex-direction: column;
}

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

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  flex-shrink: 0;
}

.section-header h2 {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ==========================================================================
   PAINEL 1: DASHBOARD (GRID DE SALAS)
   ========================================================================== */
.filter-controls {
  display: flex;
  gap: 8px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: var(--border-radius-sm);
}

.filter-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 40px;
}

.loading-spinner {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-secondary);
  font-size: 16px;
  gap: 12px;
}

.loading-spinner i {
  font-size: 32px;
  color: var(--accent-color);
}

/* CARTÃO DA SALA (ROOM CARD) */
.room-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: var(--transition-smooth);
  position: relative;
}

.room-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-focus);
  box-shadow: 0 12px 24px rgba(0,0,0,0.4), 0 0 15px rgba(99, 102, 241, 0.15);
}

.room-card-img {
  height: 160px;
  background-color: var(--bg-tertiary);
  background-size: cover;
  background-position: center;
  position: relative;
  transition: var(--transition-smooth);
}

.room-card:hover .room-card-img {
  filter: brightness(1.1);
}

/* Overlay sutil na imagem do cartão */
.room-card-img::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(18, 20, 32, 0.9) 0%, rgba(18, 20, 32, 0) 100%);
}

.room-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 50px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 1;
}

.room-badge.ready {
  background-color: var(--status-ready-bg);
  color: var(--status-ready-text);
  border: 1px solid var(--status-ready-border);
}

.room-badge.pending {
  background-color: var(--status-pending-bg);
  color: var(--status-pending-text);
  border: 1px solid var(--status-pending-border);
}

.room-badge.maintenance {
  background-color: var(--status-maintenance-bg);
  color: var(--status-maintenance-text);
  border: 1px solid var(--status-maintenance-border);
}

.room-card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.room-card-content h3 {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
  /* Truncar texto comprido */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-meta {
  display: flex;
  gap: 12px;
  margin-top: auto;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 12px;
}

.room-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-meta-item i {
  color: var(--text-muted);
}

/* ==========================================================================
   PAINEL 2: MAPA 2D INTERATIVO
   ========================================================================== */
.map-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
}

.room-selector-container select {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.room-selector-container select:focus {
  border-color: var(--accent-color);
}

.editor-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.map-view-container {
  flex-grow: 1;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  min-height: 450px;
}

.map-empty-state, .threed-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  max-width: 420px;
}

.map-empty-state i, .threed-empty-state i {
  font-size: 54px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.map-empty-state h3, .threed-empty-state h3 {
  font-family: var(--font-title);
  font-size: 18px;
  margin-bottom: 8px;
}

.map-empty-state p, .threed-empty-state p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.map-wrapper {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: inline-block;
  user-select: none;
}

.map-wrapper img {
  display: block;
  max-width: 100%;
  height: auto;
  pointer-events: none;
}

#map-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: default;
}

/* Polígonos Salvos */
#map-svg polygon.hotspot {
  fill: rgba(99, 102, 241, 0.2);
  stroke: var(--accent-color);
  stroke-width: 2px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}

#map-svg polygon.hotspot:hover {
  fill: rgba(99, 102, 241, 0.45);
  filter: drop-shadow(0 0 4px var(--accent-color));
}

#map-svg polygon.hotspot.active {
  fill: rgba(52, 211, 153, 0.35);
  stroke: var(--status-ready-text);
  stroke-width: 3px;
}

/* Linhas e pontos de desenho temporários */
#map-svg line.draw-line {
  stroke: var(--accent-color);
  stroke-width: 2px;
  stroke-dasharray: 4;
}

#map-svg circle.draw-node {
  fill: var(--text-primary);
  stroke: var(--accent-color);
  stroke-width: 2px;
  cursor: pointer;
}

#map-svg circle.draw-node:hover {
  transform: scale(1.2);
  fill: var(--accent-color);
}

.drawing-tip {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--bg-glass-accent);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 12px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  box-shadow: var(--box-shadow);
  backdrop-filter: blur(8px);
  z-index: 5;
  white-space: nowrap;
}

.drawing-tip i {
  color: var(--accent-color);
}

/* ==========================================================================
   PAINEL 3: VISUALIZAÇÃO 3D
   ========================================================================== */
.view-3d-container {
  flex-grow: 1;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  position: relative;
  overflow: hidden;
  min-height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-3d-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* Controls de visualização 3D flutuantes */
.view-3d-instructions {
  position: absolute;
  top: 16px;
  left: 16px;
  background-color: rgba(10, 11, 16, 0.85);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 11px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  z-index: 5;
}

.view-3d-instructions span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-3d-instructions i {
  color: var(--accent-color);
}

/* ==========================================================================
   GAVETA LATERAL DE DETALHES (DETAILS DRAWER - GLASSMORPHISM)
   ========================================================================== */
.details-drawer {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background-color: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
  z-index: 100;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.details-drawer.open {
  transform: translateX(-420px);
  visibility: visible;
}

.btn-close-drawer {
  position: absolute;
  top: 18px;
  left: -48px;
  width: 48px;
  height: 48px;
  background-color: var(--bg-glass-accent);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-right: none;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-close-drawer:hover {
  color: var(--accent-color);
}

.drawer-room-name-input:focus {
  border-bottom: 1px dashed var(--accent-color) !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
  padding-left: 4px !important;
  border-radius: 4px;
  outline: none;
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.room-id-tag {
  display: inline-block;
  background-color: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.drawer-header h3 {
  font-family: var(--font-title);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}

.status-select-container {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-select-container select {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-section h4 {
  font-family: var(--font-title);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-section h4 i {
  color: var(--accent-color);
}

/* CARROSSEL DE IMAGENS */
.carousel-container {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  background-color: var(--bg-tertiary);
}

.carousel-slides {
  width: 100%;
  height: 100%;
  display: flex;
  transition: transform 0.4s ease-in-out;
}

.carousel-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: var(--transition-smooth);
}

.carousel-btn:hover {
  background-color: rgba(0, 0, 0, 0.85);
  color: var(--accent-color);
}

.carousel-btn.prev { left: 8px; }
.carousel-btn.next { right: 8px; }

.carousel-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.carousel-dot.active {
  background-color: var(--text-primary);
  width: 14px;
  border-radius: 10px;
}

/* FORMULÁRIO E INPUTS */
.dimensions-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 11px;
  color: var(--text-secondary);
}

.input-group input, .input-group select {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  transition: var(--transition-smooth);
}

.input-group input:focus, .input-group select:focus {
  border-color: var(--accent-color);
  background-color: rgba(255, 255, 255, 0.07);
}

.input-group input[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.input-group.full-width {
  grid-column: 1 / -1;
}

/* INVENTÁRIO */
.inventory-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-icon-add {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-icon-add:hover {
  background-color: var(--accent-color);
  color: var(--text-primary);
}

.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.inventory-item {
  display: flex;
  gap: 8px;
  align-items: center;
  animation: slideIn 0.25s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.inventory-item input[type="text"] {
  flex-grow: 1;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.inventory-item input[type="number"] {
  width: 60px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 6px 6px;
  border-radius: 6px;
  font-size: 13px;
  text-align: center;
}

.btn-delete-item {
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  transition: var(--transition-smooth);
}

.btn-delete-item:hover {
  color: var(--status-maintenance-text);
}

/* NOTAS */
textarea#room-notes {
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 80px;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  transition: var(--transition-smooth);
}

textarea#room-notes:focus {
  border-color: var(--accent-color);
  background-color: rgba(255, 255, 255, 0.07);
}

.drawer-footer {
  padding: 18px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background-color: rgba(18, 20, 32, 0.3);
  flex-shrink: 0;
}

/* ==========================================================================
   BOTÕES E COMPONENTES GENÉRICOS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  box-shadow: 0 6px 18px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--text-muted);
}

.btn-danger {
  background-color: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--status-maintenance-border);
  color: var(--status-maintenance-text);
}

.btn-danger:hover {
  background-color: rgba(239, 68, 68, 0.25);
}

.btn-large {
  padding: 12px 24px;
  font-size: 15px;
}

/* ==========================================================================
   LAYOUT DE DUAS COLUNAS (WORKSPACE DO MAPA & 3D)
   ========================================================================== */
.sidebar-rooms-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.05) transparent;
}

.sidebar-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: var(--transition-smooth);
  cursor: pointer;
  user-select: none;
}

.sidebar-room-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-focus);
  transform: translateX(2px);
}

.sidebar-room-item.active {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.1);
}

.room-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  width: calc(100% - 75px);
}

.room-item-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.room-item-meta {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  align-items: center;
}

.room-item-meta i {
  font-size: 9px;
}

.room-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-item-indicator {
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.room-item-indicator.mapped {
  color: var(--status-ready-text);
}

.room-item-indicator.unmapped {
  color: var(--text-muted);
  opacity: 0.5;
}

.btn-action-sm {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-size: 11px;
  transition: var(--transition-smooth);
}

.btn-action-sm:hover {
  color: var(--text-primary);
  background: var(--accent-gradient);
  border-color: var(--accent-color);
  box-shadow: 0 0 5px var(--accent-glow);
}

/* Controles de Zoom & Pan no Mapa 2D */
.zoom-controls {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.btn-zoom {
  background: rgba(30, 32, 50, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-zoom:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  color: var(--text-primary);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-zoom i {
  font-size: 14px;
}

/* Ajustes para suportar Zoom & Pan */
#map-container {
  overflow: hidden !important;
  cursor: grab;
  position: relative;
  display: block !important;
}

#map-container.panning {
  cursor: grabbing;
}

#map-container.drawing {
  cursor: crosshair;
}

#map-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  transition: transform 0.05s ease-out;
  max-width: none !important;
  max-height: none !important;
  display: block;
}

#map-wrapper img {
  display: block;
  max-width: none !important;
  max-height: none !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

/* Estilos para o Pop-up de Mapeamento Rápido */
.quick-map-popup {
  border: 1px solid var(--border-color);
  background: rgba(22, 24, 38, 0.9) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
  font-family: var(--font-main);
}

.quick-map-popup select {
  background: rgba(0, 0, 0, 0.4) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  outline: none;
  font-family: var(--font-main);
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
}

.quick-map-popup select option {
  background-color: rgb(22, 24, 38);
  color: var(--text-primary);
}

.quick-map-popup button.btn-close-popup {
  transition: var(--transition-smooth);
}

.quick-map-popup button.btn-close-popup:hover {
  color: var(--status-maintenance-text) !important;
}
