:root {
  --bg-main: #0B0F19;
  --bg-panel: #111827;
  --bg-card: #1F2937;
  --bg-card-hover: #263346;
  --bg-input: #151D2C;
  --border: #374151;
  --border-light: #4B5563;
  --border-accent: #3B82F6;
  
  --text-main: #F9FAFB;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-glow: rgba(59, 130, 246, 0.25);
  
  --accent: #10B981;
  --accent-purple: #8B5CF6;
  --accent-amber: #F59E0B;
  
  --badge-cad: #6366F1;
  --badge-qty: #EC4899;
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.35);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --header-height: 64px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container */
.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Top Navigation Header */
.app-header {
  height: var(--header-height);
  background-color: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 50;
  flex-shrink: 0;
  gap: 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.dlr-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.dlr-logo-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.dlr-logo-svg {
  display: block;
  height: 18px;
  width: auto;
}

.header-divider-v {
  width: 1px;
  height: 24px;
  background-color: var(--border-light);
  margin: 0 4px;
  opacity: 0.6;
}

.title-group h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.title-group .subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

/* Level Tabs */
.level-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px 6px;
  background-color: var(--bg-input);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  scrollbar-width: none;
}

.level-tabs::-webkit-scrollbar {
  display: none;
}

.level-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.level-tab-btn:hover {
  color: var(--text-main);
  background-color: rgba(255, 255, 255, 0.05);
}

.level-tab-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Header Right: Search & Actions */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  width: 280px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 400px;
  overflow-y: auto;
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  padding: 8px 0;
}

.search-dropdown.hidden {
  display: none;
}

.search-item {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.15s;
}

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

.search-item-info {
  flex: 1;
  min-width: 0;
}

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

.search-item-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.icon-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--border-light);
  background-color: var(--bg-card);
}

/* Split Workspace */
.workspace {
  display: flex;
  flex: 1;
  height: calc(100vh - var(--header-height));
  overflow: hidden;
}

/* Left & Center: Plan Panel */
.plan-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--bg-main);
  border-right: 1px solid var(--border);
  min-width: 0;
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #0d121f;
  display: flex;
  flex-direction: column;
}

/* 1. Architectural Floor Plan View */
.floor-plan-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.floor-plan-view.hidden {
  display: none !important;
}

/* Unified Clean Sheet Bar */
.plan-sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background-color: rgba(15, 23, 42, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  z-index: 10;
  gap: 12px;
  min-height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
}

.plan-sheet-bar::-webkit-scrollbar {
  display: none;
}

.sheet-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sheet-badge {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.4);
  white-space: nowrap;
}

.sheet-title {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category Legend Filter Chips in Sheet Bar */
.plan-legend-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 6px;
  border-radius: 20px;
}

.legend-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.legend-chip:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.legend-chip.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.18);
  font-weight: 600;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-all { background: #cbd5e1; }
.dot-exam { background: #38bdf8; box-shadow: 0 0 6px rgba(56, 189, 248, 0.7); }
.dot-infusion { background: #34d399; box-shadow: 0 0 6px rgba(52, 211, 153, 0.7); }
.dot-procedure { background: #c084fc; box-shadow: 0 0 6px rgba(192, 132, 252, 0.7); }
.dot-support { background: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, 0.7); }

/* Right Sheet Actions */
.plan-sheet-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.room-jump-wrap {
  display: flex;
  align-items: center;
}

.room-jump-wrap select {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  max-width: 190px;
  outline: none;
}

.room-jump-wrap select:focus {
  border-color: var(--primary);
}

.view-toggle-group {
  display: flex;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.view-toggle-btn:hover {
  color: var(--text-main);
}

.view-toggle-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  font-weight: 600;
}

.icon-btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

.icon-btn-action:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

/* Interactive Pan/Zoom Plan Viewport */
.plan-interactive-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: #0b0f19;
  background-image: 
    radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.4) 0%, rgba(11, 15, 25, 0.9) 100%),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 100%, 32px 32px, 32px 32px;
  cursor: grab;
  user-select: none;
}

.plan-interactive-viewport.dragging {
  cursor: grabbing;
}

/* Pan/Zoom Stage */
.plan-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#planCanvas {
  display: block;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  background-color: #ffffff;
}

/* Highlights Layer */
.plan-highlights-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* High-Visibility Interactive Beacon Dot Overlay System */
.room-dot-marker {
  position: absolute;
  width: 28px;
  height: 28px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  transform: translate(-50%, -50%) scale(calc(min(2.4, 1.1 / var(--current-zoom, 1))));
  transform-origin: center center;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.dot-core {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.65), 0 0 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease;
  position: relative;
  z-index: 2;
}

.dot-beacon {
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  animation: beaconPulse 2.6s infinite ease-out;
}

@keyframes beaconPulse {
  0% { transform: scale(0.85); opacity: 0.9; }
  60% { transform: scale(1.6); opacity: 0.25; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Category Color Coding with Glowing Presence */
.cat-exam .dot-core {
  background-color: #0284c7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 12px rgba(2, 132, 199, 0.85);
}
.cat-exam .dot-beacon {
  border: 2px solid #38bdf8;
}

.cat-infusion .dot-core {
  background-color: #059669;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 12px rgba(16, 185, 129, 0.85);
}
.cat-infusion .dot-beacon {
  border: 2px solid #34d399;
}

.cat-procedure .dot-core {
  background-color: #7c3aed;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 12px rgba(139, 92, 246, 0.85);
}
.cat-procedure .dot-beacon {
  border: 2px solid #a78bfa;
}

.cat-support .dot-core {
  background-color: #d97706;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 12px rgba(245, 158, 11, 0.85);
}
.cat-support .dot-beacon {
  border: 2px solid #fbbf24;
}

/* Hover State */
.room-dot-marker:hover {
  transform: translate(-50%, -50%) scale(calc(min(2.8, 1.45 / var(--current-zoom, 1))));
  z-index: 60;
}
.room-dot-marker:hover .dot-core {
  transform: scale(1.18);
  border-color: #ffffff;
}
.room-dot-marker:hover .dot-beacon {
  animation: beaconPulse 1.4s infinite ease-out;
  opacity: 1;
}

/* Active Selected Room Dot */
.room-dot-marker.active {
  transform: translate(-50%, -50%) scale(calc(min(3.2, 1.65 / var(--current-zoom, 1))));
  z-index: 70;
}
.room-dot-marker.active .dot-core {
  background-color: #ffffff !important;
  border-color: #2563eb !important;
  transform: scale(1.25);
  box-shadow: 0 0 14px #ffffff, 0 0 25px #3b82f6, 0 2px 8px rgba(0, 0, 0, 0.8) !important;
}
.room-dot-marker.active .dot-beacon {
  border: 2.5px solid #3b82f6 !important;
  animation: beaconPulse 1.2s infinite ease-out;
}

/* Filter Dimmed State */
.room-dot-marker.dimmed {
  opacity: 0.15;
  filter: grayscale(1);
  pointer-events: none;
}

.room-dot-marker.dimmed {
  opacity: 0.12 !important;
  pointer-events: none;
}

/* Floating Plan Instruction Hint Pill */
.plan-hint-pill {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 11px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 30;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: opacity 0.3s ease;
}

.plan-hint-pill.fade-out {
  opacity: 0;
}

/* Floating Plan Controls */
.plan-floating-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(17, 24, 39, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow-lg);
  z-index: 40;
}

.plan-floating-controls button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.plan-floating-controls button:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Toggle Switch */
.toggle-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 28px;
  height: 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: all 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  left: 2px;
  top: 2px;
  background-color: var(--text-dim);
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(12px);
  background-color: #ffffff;
}

.toggle-text {
  font-weight: 500;
}

/* Highlight count pill */
.highlight-count-pill {
  font-size: 11px;
  color: var(--accent);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}

/* Loading Overlay */
.plan-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 100;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 500;
}

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

.plan-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: #3B82F6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* 2. Room Schedule View */
.room-schedule-view {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: block;
}

.room-schedule-view.hidden {
  display: none !important;
}

/* Dual View Mode Layout */
.canvas-viewport.mode-dual {
  display: grid;
  grid-template-rows: 58% 42%;
}

.canvas-viewport.mode-dual .floor-plan-view {
  display: flex !important;
  border-bottom: 2px solid var(--border-light);
}

.canvas-viewport.mode-dual .room-schedule-view {
  display: block !important;
  overflow-y: auto;
  padding: 14px 20px;
  background-color: rgba(11, 15, 25, 0.95);
}

/* Rooms Grid Container */
.rooms-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  padding-bottom: 40px;
}

.room-tile {
  background-color: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.room-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background-color: transparent;
  transition: background-color 0.2s;
}

.room-tile:hover {
  background-color: var(--bg-card);
  border-color: var(--border-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.room-tile:hover::before {
  background-color: var(--primary);
}

.room-tile.active {
  border-color: var(--primary);
  background-color: var(--bg-card);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.room-tile.active::before {
  background-color: var(--accent);
}

.room-tile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.room-tile-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
}

.room-tile-num {
  font-size: 11px;
  background-color: var(--bg-input);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.room-tile-dept {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.room-tile-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
  font-size: 12px;
}

.equip-count-tag {
  color: var(--accent);
  font-weight: 500;
}

.qty-tag {
  color: var(--text-muted);
}

/* Canvas Controls */
.canvas-controls {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background-color: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  box-shadow: var(--shadow-md);
  z-index: 10;
}

.canvas-controls button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.canvas-controls button:hover {
  background-color: var(--bg-card);
  color: var(--text-main);
}

/* Selected Room Drawer */
.room-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 48%;
  background-color: var(--bg-panel);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  z-index: 30;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.room-drawer.collapsed {
  transform: translateY(100%);
}

.room-drawer-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(31, 41, 55, 0.4);
}

.room-drawer-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.room-drawer-header .drawer-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

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

.room-equipment-list {
  padding: 14px 18px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}

/* Equipment Card */
.equipment-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.equipment-card:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.equipment-card.active {
  border-color: var(--primary);
  background-color: var(--bg-card-hover);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.equip-thumb-box {
  width: 64px;
  height: 64px;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.equip-thumb-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.equip-card-details {
  flex: 1;
  min-width: 0;
}

.equip-cad-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.cad-tag {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  background-color: var(--badge-cad);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.qty-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--badge-qty);
  background-color: rgba(236, 72, 153, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.equip-desc {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.equip-mfr {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.btn-view-cutsheet {
  background-color: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-view-cutsheet:hover {
  background-color: var(--primary);
  color: #fff;
}

/* Interactive Draggable Panel Resizer Divider */
.panel-resizer {
  width: 12px;
  margin: 0 -6px;
  cursor: col-resize;
  position: relative;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  user-select: none;
  touch-action: none;
  transition: background-color 0.15s ease;
}

.panel-resizer:hover,
.panel-resizer.dragging {
  background-color: rgba(59, 130, 246, 0.18);
}

.resizer-handle {
  width: 4px;
  height: 48px;
  border-radius: 4px;
  background-color: var(--border-light);
  transition: all 0.18s ease;
}

.panel-resizer:hover .resizer-handle,
.panel-resizer.dragging .resizer-handle {
  background-color: var(--primary);
  height: 72px;
  box-shadow: 0 0 10px var(--primary-glow);
}

/* While resizing, prevent iframes and stage from swallowing pointer events */
body.is-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.is-resizing iframe,
body.is-resizing .plan-stage {
  pointer-events: none !important;
}

/* Right Panel: Split-Screen PDF Viewer */
.pdf-panel {
  width: 48%;
  min-width: 320px;
  max-width: none;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-panel);
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.pdf-panel-header {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: rgba(17, 24, 39, 0.8);
}

.cad-badge {
  display: inline-block;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 12px;
  background-color: var(--primary);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.pdf-title-group h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
}

.pdf-title-group span {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  border: none;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
}

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

.btn-secondary {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: var(--bg-card-hover);
  border-color: var(--border-light);
}

/* Specs Summary Strip */
.specs-summary-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background-color: var(--bg-input);
  border-bottom: 1px solid var(--border);
  padding: 8px 14px;
  gap: 8px;
}

.spec-cell {
  display: flex;
  flex-direction: column;
}

.spec-cell .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.spec-cell .value {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* PDF Frame Container */
.pdf-frame-wrapper {
  flex: 1;
  position: relative;
  background-color: #2D3748;
}

.pdf-empty-state {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-muted);
  max-width: 260px;
}

.pdf-empty-state svg {
  color: var(--text-dim);
  margin-bottom: 12px;
}

.pdf-empty-state p {
  font-size: 13px;
  line-height: 1.5;
}

.pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.pdf-frame.hidden {
  display: none;
}

/* Floating Room Hover Tooltip */
.room-hover-tooltip {
  position: fixed;
  background-color: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  z-index: 200;
  pointer-events: none;
  max-width: 300px;
  transform: translate(15px, 15px);
  transition: opacity 0.15s ease;
}

.room-hover-tooltip.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.tooltip-header h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.tooltip-dept {
  font-size: 11px;
  color: var(--text-muted);
}

.tooltip-body {
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tooltip-equip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.tooltip-equip-cad {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 10px;
  color: var(--primary);
}

.tooltip-equip-desc {
  flex: 1;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tooltip-equip-qty {
  color: var(--badge-qty);
  font-weight: 600;
}

.tooltip-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 6px;
  font-size: 10px;
  color: var(--text-dim);
  text-align: center;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

.modal-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
}

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

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
}

.form-group select,
.form-group input {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 13px;
  outline: none;
}

.form-group select:focus,
.form-group input:focus {
  border-color: var(--primary);
}

.help-text {
  font-size: 11px;
  color: var(--text-dim);
}

.modal-footer {
  padding: 14px 20px;
  background-color: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
