:root {
  --bg-darker: #090d16;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-surface: #1e293b;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-light: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #334155;
  --border-subtle: #1e293b;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

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

/* Header */
.app-header {
  height: 56px;
  background-color: var(--bg-darker);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  user-select: none;
  -webkit-app-region: drag; /* Allow window dragging */
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  -webkit-app-region: no-drag;
}

/* macOS Style Window Controls (Traffic Lights) */
.window-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 0.5rem;
  -webkit-app-region: no-drag;
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s ease;
  position: relative;
  outline: none;
}

.traffic-light:hover {
  filter: brightness(1.15);
  transform: scale(1.1);
}

.traffic-light:active {
  transform: scale(0.92);
}

.traffic-light .icon {
  opacity: 0;
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
  color: rgba(0, 0, 0, 0.6);
  transition: opacity 0.15s ease;
}

.window-controls:hover .traffic-light .icon {
  opacity: 1;
}

.traffic-light.close {
  background-color: #ff5f56;
  border: 1px solid #e0443e;
}

.traffic-light.minimize {
  background-color: #ffbd2e;
  border: 1px solid #dea123;
}

.traffic-light.maximize {
  background-color: #27c93f;
  border: 1px solid #1aab29;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  -webkit-app-region: no-drag;
}

.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.4);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.brand-logo-img:hover {
  transform: scale(1.05);
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-left: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  -webkit-app-region: no-drag;
}

.project-name-input {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.15s;
  -webkit-app-region: no-drag;
}

.project-name-input:hover, .project-name-input:focus {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
  outline: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  -webkit-app-region: no-drag;
}

/* Header Dropdown Menu */
.dropdown-wrapper {
  position: relative;
  display: inline-block;
  -webkit-app-region: no-drag;
}

.menu-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.75rem;
  font-weight: 600;
  background-color: var(--bg-tertiary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.18s ease;
}

.menu-trigger-btn:hover,
.menu-trigger-btn.active {
  background-color: #334155;
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.menu-chevron {
  font-size: 0.7rem;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.menu-trigger-btn.active .menu-chevron {
  transform: rotate(180deg);
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  padding: 0.4rem;
  display: none;
  flex-direction: column;
  z-index: 1000;
  backdrop-filter: blur(16px);
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.header-dropdown-menu.show {
  display: flex;
}

.dropdown-header {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 0.4rem 0.65rem 0.2rem;
  user-select: none;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all 0.12s ease;
  user-select: none;
}

.dropdown-item:hover {
  background-color: rgba(56, 189, 248, 0.12);
  color: var(--accent-light);
}

.dropdown-item:active {
  transform: scale(0.98);
}

.dropdown-item .item-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.dropdown-item .item-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item .item-shortcut {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  margin-left: auto;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.35rem 0;
}

.export-btn-prominent {
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
  transition: all 0.18s ease;
}

.export-btn-prominent:hover {
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.5);
  transform: translateY(-1px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  user-select: none;
}

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

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.1);
}
.btn-secondary:hover {
  background-color: #475569;
}

.btn-success {
  background-color: #059669;
  color: #fff;
}
.btn-success:hover {
  background-color: #047857;
}

.btn-danger-ghost {
  background: transparent;
  color: #f87171;
  padding: 0.25rem 0.5rem;
}
.btn-danger-ghost:hover {
  background-color: rgba(239, 68, 68, 0.15);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
}

/* Main Layout */
.app-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: 290px;
  background-color: var(--bg-darker);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

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

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.sidebar-tree {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
}

.floor-group {
  margin-bottom: 0.5rem;
}

.floor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem 0.35rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  gap: 0.35rem;
}

.tree-item-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.tree-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  user-select: none;
}

.tree-inline-input {
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  padding: 0.18rem 0.4rem;
  border-radius: var(--radius-sm);
  width: 100%;
  max-width: 155px;
  cursor: text;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-inline-input:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}

.tree-inline-input:focus {
  background-color: #0c1424;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  color: var(--text-primary);
  outline: none;
  overflow: visible;
}

.floor-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.room-list {
  list-style: none;
  padding-left: 0.5rem;
}

.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.75rem 0.35rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  gap: 0.35rem;
}

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

.room-item.active {
  background-color: rgba(2, 132, 199, 0.12);
  color: var(--accent-light);
  border-left-color: var(--accent);
  font-weight: 600;
}

.room-item.active .tree-inline-input {
  color: var(--accent-light);
  font-weight: 600;
}

.room-item-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.btn-icon-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 0.18rem 0.35rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-icon-ghost:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Main Area */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  overflow-y: auto;
  padding: 1.5rem 2rem;
}

/* Navigation tabs in main */
.view-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

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

.tab-btn.active {
  background-color: var(--bg-secondary);
  color: var(--accent-light);
  font-weight: 600;
}

/* Room View Container */
.room-header-panel {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  background-color: var(--bg-secondary);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.room-header-identity {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.room-breadcrumb {
  font-size: 0.76rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.breadcrumb-label {
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.breadcrumb-separator {
  color: var(--border);
  font-size: 0.85rem;
  font-weight: 700;
}

.breadcrumb-floor-input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-light);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: text;
  max-width: 180px;
  transition: all 0.15s ease;
}

.breadcrumb-floor-input:hover {
  border-color: var(--accent);
  background-color: rgba(255, 255, 255, 0.08);
}

.breadcrumb-floor-input:focus {
  background-color: #0c1424;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
  outline: none;
}

.breadcrumb-room-tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.04);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.room-title-area {
  display: flex;
  align-items: center;
  margin-top: 0.25rem;
}

.room-title-input {
  background-color: #0b1322;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  min-width: 280px;
  max-width: 440px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: text;
  transition: all 0.15s ease;
}

.room-title-input:hover {
  border-color: var(--accent);
  background-color: #0e172a;
}

.room-title-input:focus {
  background-color: #0e172a;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2), inset 0 1px 2px rgba(0, 0, 0, 0.2);
  outline: none;
}

.room-header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.room-item-actions {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.btn-icon-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon-ghost:hover {
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-light);
  transform: scale(1.1);
}

.system-type-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-darker);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.82rem;
}

/* Results Engineering Cards Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.calc-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.calc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.calc-card.sewer::before { background: linear-gradient(90deg, #10b981, #059669); }
.calc-card.water::before { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.calc-card.vent::before { background: linear-gradient(90deg, #a855f7, #7c3aed); }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.card-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
}

.metric-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.metric-val {
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.highlight-sizing {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sizing-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.sizing-value {
  font-size: 1.4rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.sizing-value small {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-left: 2px;
}

/* Fixtures Management Section */
.section-panel {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.section-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.1rem;
  gap: 1rem;
}

.panel-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.section-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Fixture entry form */
.fixture-entry-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1.25rem;
  background-color: var(--bg-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  position: relative;
}

/* Fixture Dropdown Select */
.fixture-select-wrapper {
  flex: 1;
  position: relative;
}

.fixture-dropdown-select {
  width: 100%;
  height: 38px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fixture-dropdown-select:hover {
  border-color: var(--accent);
}

.fixture-dropdown-select:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 2px var(--accent-glow);
  background-color: #172033;
}

.fixture-dropdown-select optgroup {
  font-weight: 700;
  color: var(--accent-light);
  background-color: #0c1424;
  padding: 4px 0;
}

.fixture-dropdown-select option {
  font-weight: normal;
  color: var(--text-primary);
  background-color: #1e293b;
  padding: 6px 10px;
}

/* Autocomplete Floating Dropdown */
.fixture-autocomplete-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: #131d31;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(56, 189, 248, 0.1);
  max-height: 290px;
  overflow-y: auto;
  z-index: 1000;
  padding: 4px 0;
}

.autocomplete-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background-color 0.12s ease, border-left-color 0.12s ease;
  border-left: 3px solid transparent;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
  background-color: rgba(56, 189, 248, 0.12);
  border-left-color: var(--accent-light);
}

.autocomplete-item-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow: hidden;
}

.autocomplete-item-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.autocomplete-item-code {
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  background-color: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  color: var(--accent-light);
  font-family: var(--font-mono);
}

.autocomplete-item-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.badge-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.badge-tag.dfu {
  color: #34d399;
  background-color: rgba(16, 185, 129, 0.12);
}

.badge-tag.wsfu {
  color: #38bdf8;
  background-color: rgba(56, 189, 248, 0.12);
}

.badge-tag.valve {
  color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.12);
}

.autocomplete-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.84rem;
}

.form-select, .form-input {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.form-select:focus, .form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.qty-input-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.qty-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.qty-input {
  width: 58px;
  text-align: center;
  border-radius: var(--radius-sm);
  height: 36px;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

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

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Summary Table View */
.summary-container {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Status Bar */
.app-footer {
  height: 28px;
  background-color: var(--bg-darker);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* =========================================
   Interactive Guided Tour Styles
   ========================================= */

.tour-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 8, 16, 0.78);
  backdrop-filter: blur(2px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.tour-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.tour-highlight {
  position: relative !important;
  z-index: 9999 !important;
  outline: 3px solid var(--accent-light) !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.5) !important;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
}

.tour-popover {
  position: fixed;
  z-index: 10000;
  width: 360px;
  background-color: #1e293b;
  border: 1px solid #38bdf8;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.2);
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.tour-popover.active {
  display: flex;
  animation: popoverFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.tour-step-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-light);
}

.tour-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.25rem;
}

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

.tour-popover-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.tour-popover-body {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.tour-popover-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-nav-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 38px;
  right: 24px;
  background-color: #1e293b;
  color: #f8fafc;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent-light);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(56, 189, 248, 0.2);
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 10001;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================
   Room Fixture Setup / Batch Builder Modal Styles
   ========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(5, 9, 18, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
  animation: modalFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fixture-setup-dialog {
  background-color: #111a2e;
  border: 1px solid #334155;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(56, 189, 248, 0.15);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalScaleUp 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-header {
  padding: 1.15rem 1.5rem;
  background-color: #0c1424;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.modal-title-with-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.modal-chip {
  background-color: rgba(56, 189, 248, 0.15);
  color: var(--accent-light);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.35rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
}

/* Setup Toolbar */
.setup-toolbar {
  padding: 0.85rem 1.5rem;
  background-color: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.occupancy-filter-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-tabs {
  display: flex;
  background-color: #090e18;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid #1e293b;
  gap: 3px;
}

.filter-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-tab:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.filter-tab.active {
  background-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}

.setup-search-wrapper {
  position: relative;
  min-width: 250px;
  flex: 1;
  max-width: 320px;
}

.setup-search-input {
  width: 100%;
  padding-left: 2rem;
  padding-right: 1.8rem;
  height: 34px;
  font-size: 0.82rem;
}

/* Presets Bar */
.setup-presets-bar {
  padding: 0.6rem 1.5rem;
  background-color: rgba(9, 14, 24, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  overflow-x: auto;
  white-space: nowrap;
}

.presets-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.preset-buttons {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
}

.preset-btn {
  background-color: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.preset-btn:hover {
  background-color: #334155;
  color: #ffffff;
  border-color: var(--accent-light);
  transform: translateY(-1px);
}

/* Fixture Cards Scrollable Grid */
.fixture-cards-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  min-height: 280px;
}

.fixture-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.fixture-card {
  background-color: #19253d;
  border: 1px solid #2d3e58;
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.65rem;
  cursor: pointer;
  transition: all 0.16s ease;
  user-select: none;
  position: relative;
}

.fixture-card:hover {
  background-color: #202f4c;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.fixture-card.selected {
  background-color: rgba(56, 189, 248, 0.08);
  border-color: var(--accent-light);
  box-shadow: 0 0 0 1px var(--accent-light), 0 4px 16px rgba(56, 189, 248, 0.18);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-fixture-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-fixture-code {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  color: var(--accent-light);
  white-space: nowrap;
}

.card-metrics-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.card-stepper-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.stepper-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.stepper-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.stepper-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #475569;
  background-color: #0f172a;
  color: #f8fafc;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.stepper-btn:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.stepper-count {
  min-width: 30px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-muted);
}

.fixture-card.selected .stepper-count {
  color: var(--accent-light);
}

/* Modal Footer */
.modal-footer {
  padding: 1rem 1.5rem;
  background-color: #0c1424;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.setup-live-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.summary-pill {
  font-size: 0.76rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.summary-pill.count {
  background-color: rgba(56, 189, 248, 0.12);
  color: var(--accent-light);
  border-color: rgba(56, 189, 248, 0.3);
  font-weight: 600;
}

.summary-pill.metric strong {
  color: var(--text-primary);
  font-family: var(--font-mono);
}

.summary-pill.curve {
  background-color: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.25);
  font-weight: 600;
}

.summary-pill.curve.valve {
  background-color: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.25);
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================
   Info & Shortcuts Modal Styles
   ========================================================== */
.info-modal-card {
  background-color: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 820px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  animation: modalScaleUp 0.18s ease-out;
  overflow: hidden;
}

.info-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-section {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.info-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-light);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 0.35rem;
  margin: 0;
}

/* Shortcuts Grid */
.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.shortcut-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  transition: all 0.15s ease;
}

.shortcut-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(56, 189, 248, 0.3);
}

.shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.shortcut-keys kbd {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.76rem;
}

.shortcut-desc {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.shortcut-desc strong {
  font-size: 0.8rem;
  color: var(--text-primary);
}

.shortcut-desc span {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tips Grid */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.6rem;
}

.tip-card {
  display: flex;
  gap: 0.65rem;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
}

.tip-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.tip-card strong {
  font-size: 0.8rem;
  color: var(--accent-light);
  display: block;
  margin-bottom: 0.2rem;
}

.tip-card p {
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.35;
  margin: 0;
}

.tip-card code {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-family: var(--font-mono);
}

/* Standards Table */
.standards-table-wrapper {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.standards-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.standards-ref-table th {
  background: #1e293b;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: left;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.standards-ref-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.standards-ref-table tr:last-child td {
  border-bottom: none;
}

.standards-ref-table td strong {
  color: var(--text-primary);
}

.system-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.system-badge.sewer {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.system-badge.water {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.system-badge.vent {
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.3);
}

.info-version-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================
   Pre-Screen Splash Screen with Glassmorphism & Whole Logo
   ========================================================== */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #070d19;
  background-image: 
    radial-gradient(circle at 50% 35%, rgba(14, 165, 233, 0.22), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.15), transparent 45%),
    radial-gradient(circle at 20% 75%, rgba(16, 185, 129, 0.12), transparent 45%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s ease;
}

.splash-overlay.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

/* Ambient Animated Glass Blobs */
.splash-ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  pointer-events: none;
  animation: blobFloat 12s infinite alternate ease-in-out;
}

.splash-ambient-blob.blob-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), rgba(14, 165, 233, 0.05));
  top: 15%;
  left: 20%;
}

.splash-ambient-blob.blob-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.3), rgba(79, 70, 229, 0.05));
  bottom: 15%;
  right: 20%;
  animation-delay: -5s;
}

.splash-ambient-blob.blob-3 {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.25), transparent);
  bottom: 25%;
  left: 30%;
  animation-delay: -8s;
}

@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -25px) scale(1.08); }
  100% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Central Glassmorphic Card */
.splash-card {
  position: relative;
  z-index: 2;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.25);
  box-shadow: 
    0 30px 70px -15px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(56, 189, 248, 0.18),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 28px;
  padding: 3rem 3.5rem 2.25rem;
  max-width: 540px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: splashCardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashCardEnter {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Logo with 3D Float and Soft Glow */
.splash-logo-container {
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45), transparent 70%);
  border-radius: 50%;
  filter: blur(20px);
  animation: splashGlowPulse 3s infinite alternate ease-in-out;
}

@keyframes splashGlowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0.95; }
}

.splash-logo-img {
  position: relative;
  z-index: 1;
  width: 130px;
  height: 130px;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 30px rgba(14, 165, 233, 0.35);
  animation: splashFloat 4s infinite ease-in-out;
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* Typography */
.splash-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 75%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 0.4rem;
  text-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
}

.splash-tagline {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 0 1.25rem;
  letter-spacing: 0.02em;
}

.splash-standard-chips {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.splash-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: #94a3b8;
}

/* Progress Area */
.splash-loader-area {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.splash-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.splash-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #34d399);
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  animation: splashProgressFill 1.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashProgressFill {
  0% { width: 0%; }
  45% { width: 65%; }
  85% { width: 92%; }
  100% { width: 100%; }
}

.splash-status-text {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.splash-skip-btn {
  margin-top: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

}

/* ==========================================
   Web Beta & User Session Profile Styles
   ========================================== */
.web-beta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.35);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
}

.web-beta-badge .badge-dot {
  width: 6px;
  height: 6px;
  background-color: #38bdf8;
  border-radius: 50%;
  box-shadow: 0 0 6px #38bdf8;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.tour-btn-prominent {
  -webkit-app-region: no-drag;
  pointer-events: auto;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  transition: all 0.15s ease;
}

.tour-btn-prominent:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}

.user-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid #334155;
  border-radius: 20px;
  padding: 0.25rem 0.6rem 0.25rem 0.45rem;
  -webkit-app-region: no-drag;
  pointer-events: auto;
  user-select: none;
}

.user-avatar-icon {
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-align: left;
}

.user-name-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: #f1f5f9;
}

.user-role-tag {
  font-size: 0.65rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.btn-logout {
  margin-left: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid #475569;
  background: rgba(15, 23, 42, 0.6);
  color: #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
  -webkit-app-region: no-drag;
  pointer-events: auto;
  position: relative;
  z-index: 10;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  border-color: #ef4444;
  color: #ffffff;
  background: rgba(239, 68, 68, 0.8);
}

/* ==========================================
   Login Gatekeeper Screen (Clean Enterprise Aesthetic)
   ========================================== */
.login-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30000;
  opacity: 1;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  padding: 1.25rem;
}

.login-backdrop.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: #0f172a;
  border: 1px solid #1e293b;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 2.25rem 2rem 1.75rem;
  animation: loginSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

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

.login-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  display: block;
}

.login-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.025em;
  margin-bottom: 0.2rem;
}

.login-subtitle {
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 400;
  margin-bottom: 0.6rem;
}

.login-badge-wrap {
  margin-top: 0.35rem;
}

.login-badge-pill {
  display: inline-block;
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.login-error-msg {
  color: #f87171;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  font-size: 0.78rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  display: none;
  line-height: 1.4;
  text-align: left;
}

.login-error-msg:not(:empty) {
  display: block;
}

.login-error-msg.shake {
  animation: loginShake 0.35s ease-in-out;
}

@keyframes loginShake {
  0%, 100% { transform: translateX(0); }
  25%, 75% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}

.login-field label {
  font-size: 0.76rem;
  font-weight: 500;
  color: #cbd5e1;
}

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .field-svg {
  position: absolute;
  left: 0.8rem;
  color: #64748b;
  pointer-events: none;
  transition: color 0.15s ease;
}

.input-with-icon .form-input {
  width: 100%;
  background: #090e17;
  border: 1px solid #1e293b;
  color: #f8fafc;
  padding: 0.6rem 2.2rem 0.6rem 2.35rem;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.input-with-icon .form-input::placeholder {
  color: #475569;
}

.input-with-icon .form-input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 1px #3b82f6;
}

.input-with-icon:focus-within .field-svg {
  color: #3b82f6;
}

.btn-toggle-pass {
  position: absolute;
  right: 0.65rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.btn-toggle-pass:hover {
  color: #cbd5e1;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  font-size: 0.78rem;
  color: #94a3b8;
}

.remember-me {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  user-select: none;
  color: #94a3b8;
  font-size: 0.76rem;
}

.remember-me input[type="checkbox"] {
  accent-color: #2563eb;
  cursor: pointer;
}

.btn-login-submit {
  width: 100%;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  background: #2563eb;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  margin-top: 0.25rem;
}

.btn-login-submit:hover {
  background: #1d4ed8;
}

.btn-login-submit:active {
  background: #1e40af;
  transform: translateY(1px);
}

.login-footer {
  margin-top: 1.35rem;
  text-align: center;
  font-size: 0.7rem;
  color: #64748b;
  border-top: 1px solid #1e293b;
  padding-top: 0.85rem;
}

/* ==========================================================
   Pre-Screen Splash Screen with Highlighted Enter Action
   ========================================================== */
.splash-overlay {
  position: fixed;
  inset: 0;
  z-index: 50000;
  background-color: #070d19;
  background-image: 
    radial-gradient(circle at 50% 35%, rgba(14, 165, 233, 0.25), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.18), transparent 45%),
    radial-gradient(circle at 20% 75%, rgba(16, 185, 129, 0.14), transparent 45%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  cursor: pointer;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1), transform 0.45s ease;
}

.splash-overlay.fade-out {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

/* Ambient Animated Glass Blobs */
.splash-ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.65;
  pointer-events: none;
  animation: blobFloat 12s infinite alternate ease-in-out;
}

.splash-ambient-blob.blob-1 {
  width: 460px;
  height: 460px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), rgba(14, 165, 233, 0.05));
  top: 15%;
  left: 20%;
}

.splash-ambient-blob.blob-2 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.3), rgba(79, 70, 229, 0.05));
  bottom: 15%;
  right: 20%;
  animation-delay: -5s;
}

.splash-ambient-blob.blob-3 {
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.25), transparent);
  bottom: 25%;
  left: 30%;
  animation-delay: -8s;
}

/* Central Glassmorphic Splash Card */
.splash-card {
  position: relative;
  z-index: 2;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top-color: rgba(255, 255, 255, 0.28);
  box-shadow: 
    0 30px 80px -15px rgba(0, 0, 0, 0.85),
    0 0 50px rgba(56, 189, 248, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-radius: 28px;
  padding: 2.75rem 3.25rem 2.25rem;
  max-width: 530px;
  width: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: splashCardEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes splashCardEnter {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Logo with 3D Float and Soft Glow */
.splash-logo-container {
  position: relative;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-logo-glow {
  position: absolute;
  width: 130px;
  height: 130px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45), transparent 70%);
  border-radius: 50%;
  filter: blur(22px);
  animation: splashGlowPulse 3s infinite alternate ease-in-out;
}

@keyframes splashGlowPulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 0.95; }
}

.splash-logo-img {
  position: relative;
  z-index: 1;
  width: 110px;
  height: 110px;
  object-fit: contain;
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 30px rgba(14, 165, 233, 0.35);
  animation: splashFloat 4s infinite ease-in-out;
}

@keyframes splashFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Typography */
.splash-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 75%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 0.35rem;
  text-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
}

.splash-tagline {
  font-size: 0.86rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin: 0 0 1.15rem;
  letter-spacing: 0.02em;
}

.splash-standard-chips {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.splash-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: #94a3b8;
}

/* Progress Area */
.splash-loader-area {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.splash-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.splash-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #34d399);
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.8);
  animation: splashProgressFill 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes splashProgressFill {
  0% { width: 0%; }
  50% { width: 75%; }
  100% { width: 100%; }
}

.splash-status-text {
  font-size: 0.74rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

/* ==========================================================
   THEME-ALIGNED, PROFESSIONAL "CLICK TO ENTER" BUTTON
   ========================================================== */
.splash-enter-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.68rem 2.25rem;
  background: #2563eb;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 
    0 0 16px rgba(37, 99, 235, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.35);
  animation: themeEnterPulse 2.5s infinite ease-in-out;
  transition: all 0.15s ease;
  user-select: none;
}

@keyframes themeEnterPulse {
  0%, 100% {
    box-shadow: 0 0 14px rgba(37, 99, 235, 0.35), 0 2px 6px rgba(0, 0, 0, 0.35);
    border-color: #3b82f6;
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 26px rgba(59, 130, 246, 0.65), 0 4px 12px rgba(0, 0, 0, 0.45);
    border-color: #60a5fa;
    transform: translateY(-1px);
  }
}

.splash-enter-btn:hover {
  background: #1d4ed8;
  border-color: #60a5fa;
  box-shadow: 
    0 0 28px rgba(59, 130, 246, 0.75),
    0 4px 14px rgba(0, 0, 0, 0.45);
}

.splash-enter-btn:active {
  background: #1e40af;
  transform: translateY(1px);
}

.enter-btn-text {
  color: #ffffff;
  font-weight: 600;
}



