/* ==========================================================================
   GeoSite 3D & CAD Studio - Modern Dark Aesthetic & CAD Styling
   ========================================================================== */

:root {
  /* High-Management Engineering Palette (Sober Slate & Charcoal CAD) */
  --bg-primary: #121316;
  --bg-secondary: #181a1f;
  --bg-panel: #1f2127;
  --bg-panel-header: #191b20;
  --bg-card: #252830;
  --bg-card-hover: #2d313b;
  
  --border-subtle: #2d3139;
  --border-medium: #3b404a;
  --border-active: #4a88c7;
  --border-focus: #4a88c7;

  --text-main: #e2e5eb;
  --text-muted: #8c929e;
  --text-subtle: #5f6571;
  --text-accent: #60a5fa;

  --accent-cyan: #4a88c7;
  --accent-blue: #3b82f6;
  --accent-emerald: #10b981;
  --accent-amber: #d97706;
  --accent-cad: #4a88c7;
  --accent-skp: #d97706;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.45);
  --shadow-glow-cyan: none;
  --shadow-glow-amber: none;
  --shadow-glow-emerald: none;
  --glass-blur: none;
  
  /* CAD Precision Edges - Clean, Rectilinear, Non-bubbly */
  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-xl: 2px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */

.app-header {
  height: 64px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

.brand-logo {
  width: 42px;
  height: 42px;
  background: #0284c7;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border: 1px solid #0369a1;
}

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-text h1 span {
  color: var(--accent-cyan);
}

.brand-text .tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Search Bar in Header */
.search-container {
  flex: 0 1 440px;
  position: relative;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: rgba(11, 15, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px 6px 4px 14px;
  transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

.search-icon {
  color: var(--text-subtle);
  margin-right: 8px;
  flex-shrink: 0;
}

.search-input-wrapper input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 0.85rem;
  width: 100%;
}

.search-input-wrapper input::placeholder {
  color: var(--text-subtle);
}

.btn-search {
  background: #1e293b;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-search:hover {
  background: #334155;
  color: #fff;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 2000;
}

.search-item {
  padding: 10px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-item:hover {
  background: var(--bg-card-hover);
  color: var(--accent-cyan);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ==========================================================================
   Workspace & Map Layout
   ========================================================================== */

.app-workspace {
  flex: 1;
  position: relative;
  display: flex;
  overflow: hidden;
}

.map-view {
  flex: 1;
  height: 100%;
  width: 100%;
  z-index: 1;
  background: #06090e;
}

/* Map Overlay Tools */
.map-overlay-tools {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.tool-group {
  pointer-events: auto;
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 6px;
  display: flex;
  gap: 6px;
  box-shadow: var(--shadow-lg);
}

.basemap-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.basemap-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.basemap-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.btn-draw {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-draw:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-active);
}

.btn-draw.active {
  background: var(--accent-cyan);
  color: #0b0f17;
  border-color: var(--accent-cyan);
  font-weight: 600;
  box-shadow: var(--shadow-glow-cyan);
}

.btn-danger-ghost {
  color: #f87171;
}

.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

/* Geodata Layers Floating Widget */
.geodata-layers-widget {
  flex-direction: column;
  padding: 8px 12px;
  min-width: 270px;
  background: rgba(11, 15, 23, 0.88);
}

.geodata-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--text-main);
}

.geodata-layer-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.geodata-layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.geodata-layer-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.geodata-layer-item input[type="checkbox"] {
  accent-color: var(--accent-cyan);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.layer-pill {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-main);
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  display: block;
  width: 100%;
}

/* ==========================================================================
   Side Inspector Panel
   ========================================================================== */

.side-panel {
  width: 440px;
  min-width: 440px;
  max-width: 440px;
  height: calc(100% - 28px);
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  z-index: 950;
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.25s, max-width 0.25s, opacity 0.2s;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4);
  position: relative;
}

.side-panel.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  border-left: none !important;
  overflow: hidden !important;
  box-shadow: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

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

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
}

.panel-title h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.panel-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}

.panel-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Custom Scrollbar */
.custom-scroll::-webkit-scrollbar {
  width: 6px;
}
.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Site Summary Card */
.site-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: border-color 0.2s;
}

.site-card:hover {
  border-color: var(--border-active);
}

.site-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-cyan);
}

.coords-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

.site-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-item {
  background: rgba(11, 15, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
}

.stat-sub {
  font-size: 0.68rem;
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Section Containers */
.config-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-title svg {
  color: var(--accent-cyan);
}

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

.form-group label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Segmented Interval Control */
.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(11, 15, 23, 0.7);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.segment-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.segment-btn:hover {
  color: #fff;
}

.segment-btn.active {
  background: var(--accent-cyan);
  color: #0b0f17;
  font-weight: 600;
}

/* Custom Checkbox */
.checkbox-row {
  flex-direction: row;
  align-items: center;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  display: none;
}

.checkbox-mark {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--text-subtle);
  background: rgba(11, 15, 23, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.custom-checkbox input:checked + .checkbox-mark {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.custom-checkbox input:checked + .checkbox-mark::after {
  content: '✓';
  color: #0b0f17;
  font-size: 0.75rem;
  font-weight: 700;
}

.checkbox-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Layer Toggle List */
.layer-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.layer-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.layer-item input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--accent-cyan);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.layer-info {
  display: flex;
  flex-direction: column;
}

.layer-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
}

.layer-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Export Cards Grid */
.export-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.export-card {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}

.export-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.export-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.export-card-icon.cad {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.export-card-icon.skp {
  background: rgba(234, 88, 12, 0.15);
  color: #fb923c;
  border: 1px solid rgba(234, 88, 12, 0.3);
}

.export-card-icon.gis {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.export-card-icon.pts {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Overlay Toggles (Convenciones Google & Predios Catastro) */
.overlay-toggles {
  display: flex;
  gap: 8px;
}

.btn-tool {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.btn-tool.active {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-tool.active b {
  color: #38bdf8;
}

/* Cadastre Parcel Info Card */
.cadastre-info-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.3s ease;
}

.cadastre-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-catastro {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

#cadastreSourceLabel {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cadastre-data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.cad-lbl {
  color: var(--text-muted);
}

.cad-val {
  font-weight: 600;
  color: #fff;
  font-family: var(--font-mono);
}

.cadastre-actions-row {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 158, 11, 0.15);
}

.btn-cadastre-sv {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  transition: all 0.2s;
}

.btn-cadastre-sv:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.export-card-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.export-card-details h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.export-card-details p {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.export-btn-group {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

/* ==========================================================================
   Buttons & Controls
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: #0284c7;
  color: #fff;
  border: 1px solid #0369a1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: #0369a1;
  border-color: #38bdf8;
}

.btn-secondary {
  background: #252830;
  border: 1px solid var(--border-medium);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: #2d313b;
  border-color: var(--border-active);
  color: #fff;
}

.btn-accent {
  background: #0ea5e9;
  color: #fff;
  border: 1px solid #0284c7;
  font-weight: 600;
}

.btn-accent:hover {
  background: #0284c7;
}

.btn-cad {
  background: #dc2626;
  color: #fff;
}
.btn-cad:hover:not(:disabled) {
  background: #ef4444;
}

.btn-skp {
  background: #ea580c;
  color: #fff;
}
.btn-skp:hover:not(:disabled) {
  background: #f97316;
}

.btn-shp {
  background: #0284c7;
  color: #fff;
}
.btn-shp:hover:not(:disabled) {
  background: #0ea5e9;
}

.export-card-icon.shp {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.downloads-folder-bar {
  margin-top: 14px;
  padding: 12px;
  background: rgba(14, 165, 233, 0.08);
  border: 1px dashed rgba(14, 165, 233, 0.35);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.downloads-folder-info {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.downloads-folder-info code {
  color: #38bdf8;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Toast Download Notification */
.download-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid #38bdf8;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideUpToast 0.3s ease;
  color: #fff;
}

@keyframes slideUpToast {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.download-toast-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.download-toast-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.download-toast-desc {
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.download-toast-actions {
  display: flex;
  gap: 8px;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-subtle);
  color: var(--text-muted);
}
.btn-outline:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 12px 20px;
  font-size: 0.92rem;
}

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

/* ==========================================================================
   Converter Modal & Drop Zone
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 16, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-window {
  background: #10141d;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 3px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 30px rgba(56, 189, 248, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 14px 22px;
  background: #0b0e14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f8fafc;
}

.modal-title h3 {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #f8fafc;
  margin: 0;
}

.modal-title svg {
  color: var(--accent-cyan);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 1.25rem;
  width: 28px;
  height: 28px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #10141d;
  color: #cbd5e1;
}

.drop-zone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background: rgba(56, 189, 248, 0.02);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: var(--shadow-glow-cyan);
}

.drop-zone-icon {
  color: var(--accent-cyan);
}

.drop-zone-primary {
  font-size: 0.95rem;
  color: var(--text-main);
}

.drop-zone-primary strong {
  color: var(--accent-cyan);
}

.drop-zone-secondary {
  font-size: 0.8rem;
  color: var(--text-subtle);
}

.converter-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.converter-queue h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.file-queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.file-queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
}

.file-queue-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--font-mono);
}

.file-queue-size {
  color: var(--text-subtle);
  font-size: 0.75rem;
}

.conversion-options-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.conversion-options-bar label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.custom-select {
  background: rgba(11, 15, 23, 0.8);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  outline: none;
  flex: 1;
}

.custom-select:focus {
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   Loading Overlay
   ========================================================================== */

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 23, 0.85);
  backdrop-filter: var(--glass-blur);
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-overlay.hidden {
  display: none;
}

.loading-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px 40px;
  text-align: center;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
}

.loading-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.progress-bar-wrapper {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #3b82f6);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-step-text {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-cyan);
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.hidden {
  display: none !important;
}

/* ==========================================================================
   Modo Urbano, Presets de Medellín & Pestañas
   ========================================================================== */

.mode-toggle-group {
  display: flex;
  background: rgba(11, 15, 23, 0.7);
  padding: 3px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  gap: 3px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-btn:hover {
  color: #fff;
}

.mode-btn.active {
  background: var(--accent-cyan);
  color: #0b0f17;
  font-weight: 600;
  box-shadow: var(--shadow-glow-cyan);
}

.dropdown-wrapper {
  position: relative;
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 250px;
  z-index: 2100;
  overflow: hidden;
}

.menu-dropdown.align-right {
  left: auto;
  right: 0;
}

.export-box.collapsed .export-cards-grid,
.export-box.collapsed .downloads-folder-bar {
  display: none !important;
}

.menu-dropdown-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background 0.15s;
}

.menu-dropdown-item:hover {
  background: var(--bg-card-hover);
}

.menu-dropdown-item strong {
  font-size: 0.82rem;
  color: #fff;
}

.menu-dropdown-item span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Panel Tabs */
.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(11, 15, 23, 0.9);
  border-bottom: 1px solid var(--border-subtle);
}

.panel-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 12px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.panel-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.panel-tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
}

.tab-pane {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Project Selector Cards */
.project-selector-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-card {
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.project-card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  background: var(--bg-card-hover);
}

.project-card.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.15);
}

.project-card-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.project-card h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
}

.project-card p {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 3px;
  line-height: 1.3;
}

.custom-textarea {
  background: rgba(11, 15, 23, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  resize: vertical;
  outline: none;
  width: 100%;
}

.custom-textarea:focus {
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   Viability Banner & Semáforo
   ========================================================================== */

.viability-banner {
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  border: 1px solid transparent;
}

.viability-banner.viable {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}

.viability-banner.restrictions {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.viability-banner.inviable {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
}

.viability-score-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(11, 15, 23, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  flex-shrink: 0;
}

.viable .viability-score-circle { color: #34d399; }
.restrictions .viability-score-circle { color: #fbbf24; }
.inviable .viability-score-circle { color: #f87171; }

.viability-score-circle span#viabilityScorePct {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.score-sub {
  font-size: 0.58rem;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-top: 2px;
}

.badge-semaforo {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.viable .badge-semaforo { background: #059669; color: #fff; }
.restrictions .badge-semaforo { background: #d97706; color: #fff; }
.inviable .badge-semaforo { background: #dc2626; color: #fff; }

.viability-header-info h4 {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
}

.viability-header-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 2px;
}

/* Normative Checklist */
.sub-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.normative-checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  gap: 8px;
}

.checklist-item-title {
  font-weight: 600;
  color: #fff;
  display: block;
}

.checklist-item-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.status-pill {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
}

.status-pill.cumple { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.status-pill.alerta { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.status-pill.nocumple { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Parameters Grid */
.parameters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.param-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.p-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.p-val {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  margin-top: 2px;
}

/* Spatial Blocks List */
.section-title-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.occupancy-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.section-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.spatial-blocks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.spatial-block-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.block-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.block-color-chip {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.block-name {
  font-weight: 600;
  color: #fff;
}

.block-area-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.anteproyecto-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Modal Large for Render Preview */
.modal-lg {
  max-width: 820px;
}

.render-display-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.render-image-box {
  width: 100%;
  height: 380px;
  background: #080c14;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.render-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.render-details-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.render-details-card h4 {
  font-size: 0.9rem;
  color: #fff;
  margin-bottom: 4px;
}

.render-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.render-tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.render-pill {
  font-size: 0.68rem;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  color: var(--text-subtle);
}

/* Civil Alignments & Grading Styles */
.alignment-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  color: #f8fafc !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 3px 8px !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  letter-spacing: 0.02em;
}

.alignment-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92) !important;
}

.grading-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ==========================================================================
   Vertex Calibration Banner & Handles (Fase 2)
   ========================================================================== */

.calibration-floating-banner {
  position: absolute;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1500;
  background: rgba(11, 15, 23, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(6, 182, 212, 0.6);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 15px rgba(6, 182, 212, 0.3);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 90%;
  animation: bannerSlideDown 0.3s ease-out;
}

@keyframes bannerSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-icon {
  font-size: 1.3rem;
  line-height: 1;
}

.banner-text {
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Draggable Vertex Handle Markers */
.vertex-handle-div {
  background: transparent !important;
  border: none !important;
}

.vertex-pin {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fbbf24;
  border: 2px solid #0f172a;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vertex-pin:hover {
  transform: scale(1.35);
  background: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 1.0);
}

.vertex-pin:active {
  cursor: grabbing;
  transform: scale(1.2);
}

.vertex-idx {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 800;
  color: #0f172a;
  user-select: none;
  pointer-events: none;
}

/* ==========================================================================
   CAD ALTA GERENCIA: Left Layers Sidebar (TOC)
   ========================================================================== */
.cad-layers-sidebar {
  width: 310px;
  min-width: 310px;
  max-width: 310px;
  height: calc(100% - 28px); /* Leave room for HUD status bar */
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  z-index: 920;
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.25s, max-width 0.25s, opacity 0.2s;
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.45);
  position: relative;
}

.cad-layers-sidebar.collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  margin-left: 0 !important;
  border-right: none !important;
  overflow: hidden !important;
  box-shadow: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ==========================================================================
   CAD ALTA GERENCIA: Persistent Edge Dock Tabs (Left & Right)
   ========================================================================== */
.cad-dock-tab {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 960;
  background: #181a1f;
  border: 1px solid #3b404a;
  color: #c5cbd5;
  padding: 14px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.65);
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.cad-dock-tab:hover {
  background: #252830;
  border-color: #4a88c7;
  color: #60a5fa;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
}

.cad-dock-tab.left-tab {
  left: 0;
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.cad-dock-tab.right-tab {
  right: 0;
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.cad-dock-tab span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
}

.cad-dock-tab.hidden {
  display: none !important;
}

.layers-sidebar-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.4);
}

.layers-sidebar-header h3 {
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.layers-accordion-container {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.accordion-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.accordion-group:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.accordion-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.025);
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.accordion-header:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.accordion-header .acc-chevron {
  font-size: 10px;
  transition: transform 0.2s ease;
}

.accordion-group.closed .accordion-header .acc-chevron {
  transform: rotate(-90deg);
}

.accordion-group.closed .accordion-content {
  display: none;
}

.accordion-content {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* ==========================================================================
   CAD ALTA GERENCIA: Micro Toolstrip (Top Center)
   ========================================================================== */
.cad-center-toolstrip {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 910;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(18, 19, 22, 0.94);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.cad-center-toolstrip .btn-draw {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
  height: 28px;
}

/* ==========================================================================
   CAD ALTA GERENCIA: Real-time Bottom Status Bar (HUD)
   ========================================================================== */
.cad-status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: #06090f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 930;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #94a3b8;
  user-select: none;
}

.status-bar-section {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-crs {
  font-weight: 600;
  color: #38bdf8;
}

.status-coords {
  color: #f8fafc;
}

.status-metrics {
  color: #94a3b8;
}

.status-divider {
  color: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

.status-indicator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
}

/* ==========================================================================
   CAD ALTA GERENCIA: Cuadro Técnico de Linderos
   ========================================================================== */
.cuadro-linderos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10.5px;
  font-family: var(--font-mono, monospace);
}

.cuadro-linderos-table th {
  background: rgba(255, 255, 255, 0.05);
  color: #38bdf8;
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 700;
}

.cuadro-linderos-table td {
  padding: 4px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: #f1f5f9;
}

.cuadro-linderos-table tr:hover td {
  background: rgba(56, 189, 248, 0.06);
}

/* ==========================================================================
   CAD BOTTOM PROFILE DRAWER (Corte Topográfico A-A')
   ========================================================================== */
.cad-profile-drawer {
  position: absolute;
  bottom: 30px;
  left: 0;
  right: 0;
  height: 250px;
  background: #16181d;
  border-top: 2px solid #0284c7;
  box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  z-index: 950;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cad-profile-drawer.hidden {
  display: none !important;
}

.profile-drawer-header {
  height: 38px;
  background: #111216;
  border-bottom: 1px solid #282c35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.profile-drawer-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #f1f5f9;
  letter-spacing: 0.3px;
}

.profile-stats-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.profile-stats-chips .chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #2d313a;
  padding: 2px 7px;
  border-radius: 2px;
  color: #94a3b8;
}

.profile-stats-chips .chip b {
  color: #38bdf8;
  font-weight: 700;
}

.profile-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-grade-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--font-sans);
}

.profile-grade-input-group input {
  background: #0f1013;
  border: 1px solid #3b404b;
  color: #f8fafc;
  padding: 2px 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  border-radius: 2px;
  outline: none;
}

.profile-grade-input-group input:focus {
  border-color: #38bdf8;
}

.btn-drawer-close {
  background: transparent;
  border: 1px solid #3b404b;
  color: #94a3b8;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.15s;
}

.btn-drawer-close:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}

.profile-drawer-body {
  flex: 1;
  position: relative;
  width: 100%;
  height: calc(100% - 38px);
  background: #0f1115;
  overflow: hidden;
}

.profile-svg-container {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  border-radius: 2px;
  padding: 6px 10px;
  font-size: 11px;
  font-family: var(--font-mono, monospace);
  color: #f8fafc;
  z-index: 1000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

/* ==========================================================================
   22. MULTI-VIEWPORT DECOUPLED STUDIO (VISOR 1: GIS, VISOR 2: BIOCLIMÁTICO, VISOR 3: ARCHCAD)
   ========================================================================== */

.viewport-master-switcher {
  display: flex;
  background: var(--bg-secondary);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-medium);
  gap: 3px;
}

.vp-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vp-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.vp-tab-btn.active {
  background: #1e293b;
  border-color: #4a88c7;
  color: #60a5fa;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.viewport-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ArchCAD Workspace Layout */
.archcad-layout {
  display: flex;
  flex: 1;
  height: calc(100% - 46px);
  position: relative;
  overflow: hidden;
}

.archcad-toolbar {
  height: 46px;
  background: var(--bg-panel-header);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
  z-index: 10;
}

.archcad-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.archcad-sidebar-left {
  width: 330px;
  min-width: 310px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 5;
}

.archcad-sidebar-right {
  width: 320px;
  min-width: 300px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 5;
}

.archcad-canvas-container {
  flex: 1;
  height: 100%;
  position: relative;
  background: #0c0e12;
  overflow: hidden;
}

#archCadCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ==========================================================================
   AUTODESK AUTOCAD STYLE BOTTOM STATUS BAR & COMMAND DOCK
   ========================================================================== */
.cad-status-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: #090d14;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: 20;
  font-family: var(--font-sans);
  user-select: none;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
}

.cad-status-left, .cad-status-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cad-model-tabs {
  display: flex;
  gap: 2px;
}

.cad-tab-pill {
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cad-tab-pill:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.cad-tab-pill.active {
  background: #1e293b;
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.cad-status-separator {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0 4px;
}

.cad-status-coords {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #94a3b8;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cad-status-coords .coord-label {
  color: #64748b;
  font-weight: 600;
}

.cad-status-coords .coord-val {
  color: #f8fafc;
  min-width: 44px;
}

.cad-status-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 6px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cad-status-btn:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
}

.cad-status-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.2);
}

.cad-status-btn.btn-accent-cyan {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.08);
}
.cad-status-btn.btn-accent-cyan:hover {
  background: rgba(56, 189, 248, 0.2);
}

.cad-status-btn.btn-accent-emerald {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.3);
  background: rgba(52, 211, 153, 0.08);
}
.cad-status-btn.btn-accent-emerald:hover {
  background: rgba(52, 211, 153, 0.2);
}

.cad-status-btn.btn-accent-amber {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
}
.cad-status-btn.btn-accent-amber:hover {
  background: rgba(251, 191, 36, 0.2);
}

.cad-status-scale-wrap {
  display: flex;
  align-items: center;
  gap: 3px;
}

.cad-status-select {
  background: #0f172a;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 9.5px;
  font-family: var(--font-mono);
  padding: 1px 4px;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

/* AutoCAD Command Line Dock (Floating) */
.cad-cli-dock {
  position: absolute;
  bottom: 36px;
  left: 20px;
  max-width: 580px;
  width: calc(100% - 40px);
  z-index: 18;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.2s ease;
}

.cad-cli-dock:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.cad-cli-prompt {
  display: flex;
  align-items: center;
  padding: 4px 10px;
  gap: 8px;
}

.cad-cli-prefix {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #38bdf8;
  text-transform: uppercase;
}

#cadCliInput {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 0;
}

#cadCliInput::placeholder {
  color: #475569;
  font-size: 10.5px;
}

.btn-cli-help {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #64748b;
  width: 18px;
  height: 18px;
  border-radius: 2px;
  font-size: 10px;
  font-family: var(--font-mono);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cli-help:hover {
  color: #f8fafc;
  border-color: #38bdf8;
}

.cad-cli-output {
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 10px;
  color: #cbd5e1;
  max-height: 80px;
  overflow-y: auto;
}

/* Bioclimatic Workspace Layout */
.bio-layout {
  display: flex;
  flex: 1;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.bio-sidebar-left {
  width: 330px;
  min-width: 310px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 14px;
}

.bio-canvas-container {
  flex: 1;
  height: 100%;
  position: relative;
  background: #090c10;
  overflow: hidden;
}

#bioSolarCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.bio-sidebar-right {
  width: 320px;
  min-width: 300px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 14px;
}

/* Space items list in ArchCAD */
.space-item-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  padding: 8px 10px;
  margin-bottom: 6px;
  transition: all 0.15s;
}

.space-item-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(56, 189, 248, 0.3);
}

.space-item-card.selected {
  border-color: #38bdf8;
  background: rgba(2, 132, 199, 0.15);
}

.space-color-pill {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

/* ==========================================================================
   22. DESKTOP CAD CLASSIC MENUBAR
   ========================================================================== */
.cad-menubar {
  height: 27px;
  background: #14171d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 2px;
  user-select: none;
  z-index: 1000;
  position: relative;
  font-family: var(--font-sans);
}

.cad-menu-wrapper {
  position: relative;
}

.cad-menu-trigger {
  background: none;
  border: none;
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  gap: 3px;
}

.cad-menu-trigger:hover,
.cad-menu-trigger.active {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.cad-menu-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 275px;
  background: #10141d;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 3px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(56, 189, 248, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 5px 0;
  z-index: 2500;
}

.cad-menu-item {
  padding: 6px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.12s ease;
}

.cad-menu-item:hover {
  background: linear-gradient(90deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  padding-left: 16px;
}

.cad-menu-item .menu-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cad-menu-item .menu-shortcut {
  font-size: 9.5px;
  color: #64748b;
  font-family: var(--font-mono);
}

.cad-menu-item:hover .menu-shortcut {
  color: rgba(255, 255, 255, 0.75);
}

.cad-menu-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.07);
  margin: 4px 0;
}

/* ==========================================================================
   23. GEOAGENT: CO-PILOTO ASISTENTE VIRTUAL CON VOZ
   ========================================================================== */
.geoagent-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3100;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.geoagent-hud-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #14171d;
  border: 1px solid #0284c7;
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.geoagent-hud-btn:hover {
  transform: scale(1.06);
  border-color: #38bdf8;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.hud-glow-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px dashed rgba(56, 189, 248, 0.4);
  animation: rotate-ring 12s linear infinite;
}

@keyframes rotate-ring {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.hud-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #0284c7;
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 2px;
  font-family: var(--font-mono);
}

.geoagent-drawer {
  width: 350px;
  height: 480px;
  background: #14171d;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 2px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-up-drawer 0.2s ease-out;
}

@keyframes slide-up-drawer {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.geoagent-header {
  padding: 10px 14px;
  background: #181b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.geoagent-chips {
  display: flex;
  gap: 5px;
  padding: 8px 12px;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.geoagent-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 2px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.12s;
}

.geoagent-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
}

.geoagent-messages {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-msg {
  max-width: 88%;
  padding: 8px 12px;
  font-size: 11.5px;
  line-height: 1.45;
  border-radius: 2px;
}

.agent-msg.bot {
  align-self: flex-start;
  background: #1c212c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
}

.agent-msg.user {
  align-self: flex-end;
  background: #0284c7;
  color: #fff;
}

.geoagent-voice-wave {
  padding: 6px 12px;
  background: rgba(2, 132, 199, 0.15);
  border-top: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  gap: 3px;
}

.wave-bar {
  width: 3px;
  height: 12px;
  background: #38bdf8;
  border-radius: 1px;
  animation: sound-wave 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 16px; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 10px; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; height: 14px; }

@keyframes sound-wave {
  from { transform: scaleY(0.4); }
  to { transform: scaleY(1.4); }
}

.geoagent-input-bar {
  padding: 8px 10px;
  background: #181b22;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 6px;
}

.geoagent-input-bar input {
  flex: 1;
  background: #0d1015;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  color: #f8fafc;
  padding: 6px 10px;
  font-size: 11px;
  outline: none;
}

.geoagent-input-bar input:focus {
  border-color: #38bdf8;
}

.btn-voice {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  padding: 6px 8px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
}

.btn-voice:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
}

.btn-voice.listening {
  background: #ef4444;
  color: #fff;
  border-color: #dc2626;
  animation: pulse-dot 1s infinite alternate;
}

.btn-send {
  background: #0284c7;
  border: 1px solid #0369a1;
  color: #fff;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.btn-send:hover {
  background: #0369a1;
}

/* ==========================================================================
   26. CAD TOAST NOTIFICATION CONTAINER (HIGH EXECUTIVE LOOK)
   ========================================================================== */
.cad-toast-container {
  position: fixed;
  bottom: 84px;
  right: 24px;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  z-index: 10000;
  pointer-events: none;
}

.cad-toast {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-left: 4px solid #38bdf8;
  color: #f8fafc;
  padding: 10px 14px;
  font-size: 11.5px;
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-width: 380px;
  word-break: break-word;
  transition: opacity 0.2s, transform 0.2s;
}

.cad-toast.toast-error {
  border-left-color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

.cad-toast.toast-success {
  border-left-color: #10b981;
  border-color: rgba(16, 185, 129, 0.4);
}

.cad-toast.toast-out {
  opacity: 0;
  transform: translateY(8px);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   27. STARTUP LAUNCHER MODAL (AUTOCAD/REVIT STYLE WELCOME HUB)
   ========================================================================== */
.startup-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 11, 16, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease-out;
}

.startup-modal-window {
  background: #10141d;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(56, 189, 248, 0.08);
  width: 1000px;
  max-width: 96vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 4px;
  overflow: hidden;
}

.startup-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #0b0e14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.startup-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.startup-modal-title h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.startup-modal-title span {
  font-size: 11px;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: 2px;
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.startup-modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.startup-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.startup-card {
  background: #141923;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.startup-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.startup-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.startup-template-item {
  background: #0f131a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.startup-template-item:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
  transform: translateX(2px);
}

.startup-template-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
}

.startup-template-desc {
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.35;
}

.startup-sample-btn {
  background: #0f131a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.startup-sample-btn:hover {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
}

.startup-drop-zone {
  border: 2px dashed rgba(56, 189, 248, 0.3);
  background: rgba(56, 189, 248, 0.03);
  border-radius: 4px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.startup-drop-zone:hover, .startup-drop-zone.dragover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

.startup-recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #0f131a;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.startup-recent-item:hover {
  background: rgba(56, 189, 248, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
}

.startup-footer-bar {
  padding: 12px 24px;
  background: #0b0e14;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #64748b;
}

/* ==========================================================================
   28. VISOR 4: COSTOS & PRESUPUESTOS APU COLOMBIA
   ========================================================================== */
.costos-layout {
  display: flex;
  height: 100%;
  width: 100%;
  background: #0c0f16;
  overflow: hidden;
}

.costos-sidebar {
  width: 380px;
  min-width: 340px;
  background: #0f131c;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.costos-sidebar-header {
  padding: 14px 16px;
  background: #0b0e14;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.costos-chapters-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.apu-chapter-group {
  background: #141822;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.apu-chapter-header {
  padding: 8px 12px;
  background: #181d28;
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.apu-chapter-items {
  display: flex;
  flex-direction: column;
}

.apu-item-row {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 11px;
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.apu-item-row:hover {
  background: rgba(56, 189, 248, 0.06);
  color: #f8fafc;
}

.apu-item-row.active {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-left: 3px solid #38bdf8;
}

.costos-main-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0c0f16;
}

.costos-top-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 16px 20px;
  background: #10141d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apu-card-metric {
  background: #151a24;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.apu-card-metric .metric-label {
  font-size: 10px;
  text-transform: uppercase;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.apu-card-metric .metric-val {
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
}

.costos-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.apu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  color: #cbd5e1;
  background: #121620;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}

.apu-table th {
  background: #181d28;
  color: #94a3b8;
  text-align: left;
  padding: 8px 12px;
  font-weight: 700;
  font-size: 10.5px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apu-table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.apu-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.apu-table .num-col {
  text-align: right;
  font-family: var(--font-mono, monospace);
}

/* ==========================================================================
   29. VISOR 5: GESTIÓN & CONTROL DE OBRA (GANTT CPM, KARDEX, ACTAS)
   ========================================================================== */
.gestion-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  background: #0c0f16;
  overflow: hidden;
}

.gestion-subtabs-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: #10141d;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gestion-subtab-btn {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gestion-subtab-btn:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.04);
}

.gestion-subtab-btn.active {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
}

.gestion-content-body {
  flex: 1;
  overflow: auto;
  padding: 16px 20px;
}

.gantt-svg-wrapper {
  background: #10141e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow-x: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.gantt-critical-bar {
  fill: #ef4444;
  filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.6));
}

.gantt-normal-bar {
  fill: #0284c7;
}

.kardex-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  background: #10141e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
}

.kardex-table th {
  background: #161b26;
  color: #94a3b8;
  padding: 9px 12px;
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
}

.kardex-table td {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.kardex-badge-in {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 9.5px;
}

.kardex-badge-out {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  padding: 2px 6px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 9.5px;
}

/* ACTAS DE OBRA OFICIALES (A4 PRINT STYLE) */
.acta-sheet {
  background: #ffffff;
  color: #0f172a;
  max-width: 820px;
  margin: 0 auto;
  padding: 48px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  font-family: Arial, sans-serif;
  line-height: 1.5;
  border-radius: 2px;
}

.acta-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.acta-signatures {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px dashed #cbd5e1;
}

.acta-sign-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
}

.acta-sign-line {
  border-bottom: 1px solid #0f172a;
  height: 40px;
  margin-bottom: 4px;
}

/* ==========================================================================
   30. ARCHCAD LEVEL MANAGER & PARAMETRIC ASSETS
   ========================================================================== */
.cad-level-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #141822;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  cursor: pointer;
  font-size: 11px;
  color: #cbd5e1;
  transition: all 0.15s ease;
}

.cad-level-row:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.3);
}

.cad-level-row.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #38bdf8;
  font-weight: 700;
}

.cad-asset-card {
  background: #141822;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.cad-asset-card:hover {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  transform: translateY(-1px);
}

/* ==========================================================================
   31. FACHADAS & CORTES (ELEVATIONS MODAL)
   ========================================================================== */
.elevation-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.elevation-card {
  background: #0f131c;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.elevation-header {
  padding: 8px 14px;
  background: #161b26;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11.5px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.elevation-svg-container {
  padding: 12px;
  background: #0a0d13;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   32. DOWNLOAD BUTTON STATES (BLOB PROGRESS)
   ========================================================================== */
.btn.downloading {
  opacity: 0.75;
  pointer-events: none;
  position: relative;
}

.btn.downloading::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

/* ==========================================================================
   33. CURVA S & VALOR GANADO (EVM) CHART
   ========================================================================== */
.curva-s-tooltip {
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}

/* ==========================================================================
   34. BITÁCORA DIGITAL DE OBRA
   ========================================================================== */
.bitacora-entry-card {
  transition: all 0.2s ease;
}

.bitacora-entry-card:hover {
  background: #1c2230 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

/* ==========================================================================
   35. GEOAGENT VOICE CO-PILOT ANIMATIONS
   ========================================================================== */
.btn-voice.mic-active {
  animation: pulseMic 1.2s infinite alternate;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.8);
}

@keyframes pulseMic {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.geoagent-voice-wave {
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.wave-bar {
  width: 3px;
  height: 14px;
  background: #38bdf8;
  border-radius: 1px;
  animation: waveSound 0.8s ease-in-out infinite alternate;
}

.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 18px; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 10px; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; height: 16px; }

@keyframes waveSound {
  0% { transform: scaleY(0.4); }
  100% { transform: scaleY(1.3); }
}

/* ==========================================================================
   DESACOPLAMIENTO ESTRICTO: AISLAMIENTO ABSOLUTO DE SECCIÓN 1 (TERRITORIAL GIS)
   Capas y Cartografía (#sidebar), Estudio de Predio (#sidePanel),
   Barra Rectángulo / Polígono (.cad-center-toolstrip), Perfil (#cadProfileDrawer),
   Barra de Coordenadas (#cadStatusBar) y Leaflet Draw SOLO VISIBLES EN VISOR 1
   ========================================================================== */
body:not([data-active-viewport="gis"]) #layersSidebar,
body:not([data-active-viewport="gis"]) .cad-layers-sidebar,
body:not([data-active-viewport="gis"]) #btnToggleLayersSidebar,
body:not([data-active-viewport="gis"]) #btnDockTabLeft,
body:not([data-active-viewport="gis"]) #map,
body:not([data-active-viewport="gis"]) #sidebar,
body:not([data-active-viewport="gis"]) #sidebarToggle,
body:not([data-active-viewport="gis"]) #sidePanel,
body:not([data-active-viewport="gis"]) #btnToggleSidePanel,
body:not([data-active-viewport="gis"]) .cad-center-toolstrip,
body:not([data-active-viewport="gis"]) #cadProfileDrawer,
body:not([data-active-viewport="gis"]) #cadStatusBar,
body:not([data-active-viewport="gis"]) .leaflet-draw,
body:not([data-active-viewport="gis"]) .leaflet-draw-toolbar,
body:not([data-active-viewport="gis"]) .leaflet-draw-section,
body:not([data-active-viewport="gis"]) .leaflet-control-container,
body:not([data-active-viewport="gis"]) .leaflet-top,
body:not([data-active-viewport="gis"]) .leaflet-bottom {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Ensure ArchCAD bottom status bar is displayed in Visor 3 */
#archCadBottomStatusBar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Print Stylesheet: Clean Layout Sheet Export (Pliego ARQ-01) */
@media print {
  body * {
    visibility: hidden !important;
  }
  #archCadCanvasWrapper,
  #archCadCanvas {
    visibility: visible !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    background: #ffffff !important;
  }
  .cad-status-bar,
  .cad-cli-dock,
  .archcad-sidebar-left,
  .archcad-sidebar-right,
  .archcad-toolbar,
  .main-header,
  .navbar,
  .app-sidebar {
    display: none !important;
    visibility: hidden !important;
  }
}

/* ==========================================================================
   TERRAIN MODIFIER STUDIO (LOW-POLY SKETCHUP & EXPLANACIONES 3D)
   ========================================================================== */
#modalTerrainModifier .modal-window {
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.97) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

#terrainModifier3DCanvas {
  touch-action: none;
}

#terrainModifier3DCanvas:active {
  cursor: grabbing !important;
}

.btn-skp {
  background: #d97706;
  border: 1px solid #b45309;
  color: #ffffff;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-skp:hover {
  background: #b45309;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
}

/* ==========================================================================
   ENTERPRISE AEC SUITE - THEME SYSTEM (MODO CLARO / MODO OSCURO)
   ========================================================================== */

body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-panel: #ffffff;
  --bg-panel-header: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-active: #0284c7;
  --border-focus: #0284c7;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --text-accent: #0284c7;

  --shadow-lg: 0 4px 14px rgba(0, 0, 0, 0.08);
}

body.light-theme .app-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.light-theme .search-input-wrapper {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.light-theme .search-input-wrapper input {
  color: #0f172a;
}

body.light-theme .brand-text h1 {
  color: #0f172a;
}

body.light-theme .cad-status-bar {
  background: #f1f5f9;
  border-top: 1px solid #cbd5e1;
}

body.light-theme .cad-status-btn {
  color: #475569;
}

body.light-theme .cad-status-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.light-theme .cad-status-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: #0284c7;
  color: #0284c7;
}

body.light-theme .btn-secondary {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

body.light-theme .btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

body.light-theme .panel-card-wrap,
body.light-theme .apu-card-metric,
body.light-theme .archcad-sidebar-left,
body.light-theme .archcad-sidebar-right,
body.light-theme .costos-sidebar-left,
body.light-theme .costos-sidebar-right,
body.light-theme .costos-main-center {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

body.light-theme .apu-table th {
  background: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}

body.light-theme .apu-table td {
  border-color: #f1f5f9;
  color: #1e293b;
}

body.light-theme .apu-table tr:hover td {
  background: #f8fafc;
}

/* ==========================================================================
   WORKSPACE SWITCHER DROPDOWN & THEME TOGGLE
   ========================================================================== */

.workspace-switcher-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.vp-home-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vp-home-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-medium);
}

.workspace-dropdown-container {
  position: relative;
}

.workspace-switcher-trigger {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 5px 10px 5px 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.workspace-switcher-trigger:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
}

.workspace-tag {
  background: #0284c7;
  color: #ffffff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.5px;
}

.workspace-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
}

.switcher-arrow {
  color: var(--text-subtle);
  transition: transform 0.2s ease;
}

.workspace-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  padding: 6px;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.workspace-dropdown-header {
  font-size: 9.5px;
  font-weight: 800;
  color: var(--text-subtle);
  padding: 6px 8px 4px 8px;
  letter-spacing: 0.8px;
}

.workspace-option-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s ease;
}

.workspace-option-btn:hover {
  background: var(--bg-card-hover);
}

.workspace-option-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.35);
}

.workspace-option-btn .opt-tag {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 2px;
  color: #fff;
  min-width: 32px;
  text-align: center;
}

.opt-tag.tag-gis { background: #0284c7; }
.opt-tag.tag-bio { background: #d97706; }
.opt-tag.tag-cad { background: #0284c7; }
.opt-tag.tag-apu { background: #10b981; }
.opt-tag.tag-obra { background: #f59e0b; }

.workspace-option-btn .opt-info {
  display: flex;
  flex-direction: column;
}

.workspace-option-btn .opt-info strong {
  font-size: 11px;
  color: var(--text-main);
}

.workspace-option-btn .opt-info small {
  font-size: 9.5px;
  color: var(--text-muted);
}

.btn-theme-toggle {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-amber);
}

/* ==========================================================================
   COLLAPSIBLE TRAY SYSTEM (REVIT / SKETCHUP TRAY STYLE)
   ========================================================================== */

.archcad-sidebar-right {
  width: 310px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border-subtle);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.tray-accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  overflow: hidden;
  transition: all 0.2s ease;
}

.tray-header {
  width: 100%;
  background: var(--bg-panel-header);
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.tray-header:hover {
  background: var(--bg-card-hover);
}

.tray-title-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tray-toggle-icon {
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.tray-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-main);
}

.tray-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 2px;
  letter-spacing: 0.3px;
}

.tray-badge.badge-blue {
  background: rgba(2, 132, 199, 0.15);
  color: #0284c7;
  border: 1px solid rgba(2, 132, 199, 0.3);
}

.tray-badge.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.tray-body {
  padding: 12px;
  display: block;
}

.tray-accordion.collapsed .tray-body {
  display: none;
}

.tray-accordion.collapsed .tray-header {
  border-bottom: none;
}

.tray-accordion.collapsed .tray-toggle-icon {
  transform: rotate(-90deg);
}

.tray-empty-hint {
  color: var(--text-subtle);
  font-size: 11px;
  line-height: 1.4;
}

.space-cat-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 2px;
  background: #0284c7;
  color: #ffffff;
}

.tray-input-number {
  width: 80px;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  color: var(--text-main);
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  border-radius: 2px;
}

.tray-slider {
  width: 100%;
  accent-color: #0284c7;
  cursor: pointer;
}

.tray-calc-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 8px 10px;
  border-radius: 2px;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ArchDaily Enriched Cards */
.archdaily-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.archdaily-card:hover {
  border-color: var(--accent-cyan);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

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

.archdaily-icon {
  flex-shrink: 0;
}

.archdaily-scheme-title {
  font-size: 11.5px;
  font-weight: 700;
  display: block;
}

.archdaily-tag {
  font-size: 9.5px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}

.archdaily-scheme-desc {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.btn-apply-archdaily {
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-main);
  font-size: 10px;
  padding: 4px 8px;
  font-weight: 600;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-apply-archdaily:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #fff;
}

/* ==========================================================================
   VISOR 5: PROJECT BROWSER & GESTOR DOCUMENTAL TÉCNICO & LEGAL
   ========================================================================== */

.gestion-layout-twocol {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.gestion-project-browser {
  width: 260px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-subtle);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex-shrink: 0;
}

.browser-project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.browser-badge {
  font-size: 9px;
  font-weight: 800;
  color: #0284c7;
  background: rgba(2, 132, 199, 0.12);
  padding: 2px 6px;
  border-radius: 2px;
}

.browser-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.browser-project-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 2px 0;
}

.browser-project-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  display: block;
}

.browser-kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-subtle);
}

.kpi-mini {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 9px;
  color: var(--text-subtle);
}

.kpi-val {
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 700;
}

.text-cyan { color: #0284c7; }
.text-red { color: #ef4444; }
.text-emerald { color: #10b981; }
.text-amber { color: #f59e0b; }

.browser-nav-groups {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-header {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-subtle);
  letter-spacing: 0.6px;
  padding: 8px 4px 4px 4px;
}

.browser-nav-groups .gestion-subtab-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 7px 10px;
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.15s ease;
}

.browser-nav-groups .gestion-subtab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.browser-nav-groups .gestion-subtab-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0284c7;
}

.nav-badge-pill {
  margin-left: auto;
  font-size: 8.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 2px;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.gestion-stage-content {
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--bg-primary);
}

.panel-card-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.chip-kpi {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 6px;
  border-radius: 2px;
  font-size: 10.5px;
}

/* Documental Workbench */
.documental-workbench-layout {
  display: flex;
  gap: 16px;
  height: 100%;
}

.documental-selector-pane {
  width: 310px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.documental-list-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  overflow-y: auto;
}

.doc-item-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.doc-item-btn:hover {
  border-color: var(--accent-cyan);
  background: var(--bg-card-hover);
}

.doc-item-btn.active {
  border-color: #0284c7;
  background: rgba(2, 132, 199, 0.1);
}

.doc-icon-wrap {
  font-size: 18px;
  flex-shrink: 0;
}

.doc-meta {
  display: flex;
  flex-direction: column;
}

.doc-meta strong {
  font-size: 11.5px;
  color: var(--text-main);
}

.doc-meta small {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

.documental-sheet-viewport {
  flex: 1;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  padding: 6px 12px;
}

.document-sheet-container {
  width: 100%;
  max-width: 820px;
}

/* Official Document Paper Sheet */
.acta-sheet-official {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  border: 1px solid #cbd5e1;
  border-radius: 2px;
  padding: 36px 44px;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.6;
}

.sheet-institutional-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 2px solid #0f172a;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.sheet-tag {
  font-size: 9.5px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  display: block;
}

.sheet-doc-title {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
  margin: 4px 0 2px 0;
  letter-spacing: 0.3px;
}

.sheet-doc-sub {
  font-size: 10.5px;
  font-weight: 700;
  color: #0284c7;
}

.header-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.doc-code-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 2px;
}

.doc-date-val, .doc-loc-val {
  font-size: 10.5px;
  color: #475569;
}

.doc-body-section {
  color: #1e293b;
}

.doc-subheading {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  margin: 16px 0 6px 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.doc-legal-list {
  padding-left: 18px;
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0;
  font-size: 11px;
}

.doc-legal-table th, .doc-legal-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 8px;
}

.doc-legal-table th {
  background: #f8fafc;
  font-weight: 700;
  color: #1e293b;
}

.doc-stamp-box {
  margin-top: 24px;
  background: #f0fdf4;
  border: 1px dashed #10b981;
  border-radius: 2px;
  padding: 10px 14px;
}

.sheet-signatures-block {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  padding-top: 16px;
  text-align: center;
}

.sig-column {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sig-line {
  width: 100%;
  height: 1px;
  background: #0f172a;
  margin-bottom: 6px;
}

.sig-name {
  font-size: 11px;
  font-weight: 800;
  color: #0f172a;
}

.sig-role {
  font-size: 9.5px;
  font-weight: 700;
  color: #0284c7;
}

.sig-details {
  font-size: 9.5px;
  color: #64748b;
  line-height: 1.3;
  margin-top: 2px;
}

@media print {
  body * {
    visibility: hidden;
  }
  .acta-sheet-official, .acta-sheet-official * {
    visibility: visible;
  }
  .acta-sheet-official {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    padding: 0;
  }
}



