/* ============================================================
   WB-STEEL — Modern Engineering Design System
   Dual Theme (Dark / Light) & CAD Aesthetics
   ============================================================ */

:root, [data-theme="dark"] {
  --bg-primary:      #0b1120;
  --bg-secondary:    #111c35;
  --bg-tertiary:     #172545;
  --bg-card:         #131f3b;
  --bg-hover:        rgba(59, 130, 246, 0.08);
  --accent-blue:     #3b82f6;
  --accent-teal:     #14b8a6;
  --accent-amber:    #f59e0b;
  --accent-rose:     #f43f5e;
  --text-primary:    #f8fafc;
  --text-secondary:  #94a3b8;
  --text-muted:      #64748b;
  --border:          rgba(59, 130, 246, 0.2);
  --border-subtle:   rgba(255, 255, 255, 0.06);
  --canvas-bg:       #090e1a;
  --th-bg:           #111c35;
  --tr-even:         rgba(255, 255, 255, 0.015);
  --sidebar-w:       240px;
  --header-h:        60px;
  --radius-lg:       12px;
  --radius-md:       8px;
  --radius-sm:       6px;
  --shadow-modal:    0 24px 60px rgba(0, 0, 0, 0.7);
  --transition:      all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary:      #f8fafc;
  --bg-secondary:    #ffffff;
  --bg-tertiary:     #f1f5f9;
  --bg-card:         #ffffff;
  --bg-hover:        rgba(37, 99, 235, 0.06);
  --accent-blue:     #2563eb;
  --accent-teal:     #0d9488;
  --accent-amber:    #d97706;
  --accent-rose:     #e11d48;
  --text-primary:    #0f172a;
  --text-secondary:  #475569;
  --text-muted:      #94a3b8;
  --border:          rgba(203, 213, 225, 0.85);
  --border-subtle:   rgba(226, 232, 240, 0.9);
  --canvas-bg:       #f8fafc;
  --th-bg:           #f1f5f9;
  --tr-even:         rgba(241, 245, 249, 0.6);
  --shadow-modal:    0 24px 60px rgba(15, 23, 42, 0.2);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

/* Layout */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  grid-area: sidebar;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  user-select: none;
}

.sidebar-logo {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
}
.logo-text { font-size: 17px; font-weight: 800; letter-spacing: -0.5px; }
.logo-text span { color: var(--accent-blue); }

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-tab-hint {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  transition: var(--transition);
}
.sidebar.keyboard-focused {
  border-right-color: var(--accent-blue);
  box-shadow: inset -2px 0 12px rgba(59, 130, 246, 0.25);
}
.sidebar.keyboard-focused .sidebar-tab-hint {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}
.sidebar.keyboard-focused .nav-item.active {
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.45);
}
.table-scroll.keyboard-focused {
  border-color: var(--accent-blue);
  box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.15);
}

.nav-list { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; }

/* Clean sidebar nav item: NO pill badges */
.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.04));
  color: var(--accent-blue);
  font-weight: 700;
  box-shadow: inset 3px 0 0 var(--accent-blue);
}
.nav-count {
  font-size: 11px;
  background: var(--bg-tertiary);
  padding: 1px 7px;
  border-radius: 10px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.nav-item.active .nav-count {
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  font-weight: 600;
}

.sidebar-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 12px 16px;
}
.sidebar-footer {
  margin-top: auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}
.footer-title { font-weight: 700; color: var(--text-secondary); margin-bottom: 2px; }
.footer-meta { font-size: 10px; margin-bottom: 8px; }
.density-badge {
  font-size: 10.5px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--accent-blue);
}
.density-badge strong { color: var(--text-primary); }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  grid-area: header;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  z-index: 50;
}

.search-wrap {
  flex: 1;
  max-width: 440px;
  position: relative;
}
.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}
#searchInput {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 32px 8px 36px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}
#searchInput::placeholder { color: var(--text-muted); }
#searchInput:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: var(--transition);
}
.search-clear-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

/* Global Search Dropdown */
.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 440px;
  max-width: 540px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  z-index: 200;
  backdrop-filter: blur(12px);
  padding: 6px 0;
}
.gs-header {
  padding: 8px 14px 6px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.gs-header-badge {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
}
.gs-group-title {
  padding: 8px 14px 4px 14px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg-tertiary);
  margin-top: 4px;
}
.gs-group-title:first-of-type { margin-top: 0; }
.gs-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.gs-item:hover, .gs-item.active {
  background: rgba(59, 130, 246, 0.12);
}
.gs-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.gs-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
  white-space: nowrap;
}
.gs-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.gs-weight {
  font-weight: 600;
  color: var(--accent-teal);
}
.gs-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Modern Unified Header Action Button */
.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}
.btn-header-action svg {
  color: var(--text-muted);
  transition: color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.btn-header-action:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(59, 130, 246, 0.45);
}
.btn-header-action:hover svg {
  color: var(--accent-blue);
}
.btn-header-action:active {
  transform: translateY(1px);
}
.btn-header-action.active {
  background: rgba(59, 130, 246, 0.16);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}
.btn-header-action.active svg {
  color: var(--accent-blue);
}

/* Backward compatibility aliases */
.btn-compare-header,
.btn-calc-header,
.btn-help-header {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 11px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  box-sizing: border-box;
}
.btn-compare-header:hover,
.btn-calc-header:hover,
.btn-help-header:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: rgba(59, 130, 246, 0.45);
}

/* Unit Toggle: Metric vs Imperial */
.unit-toggle-wrap { display: flex; align-items: center; }
.unit-toggle {
  display: flex;
  align-items: center;
  height: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  box-sizing: border-box;
}
.unit-btn {
  height: 26px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 550;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.unit-btn:hover { color: var(--text-primary); }
.unit-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 32px;
  height: 32px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  box-sizing: border-box;
}
.theme-toggle-btn:hover {
  color: var(--accent-blue);
  border-color: rgba(59, 130, 246, 0.45);
  background: var(--bg-hover);
}

.badge-count {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  box-sizing: border-box;
}
.badge-count span { color: var(--accent-blue); font-weight: 700; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  grid-area: main;
  display: grid;
  grid-template-columns: 1fr 370px;
  min-height: 0;
  overflow: hidden;
}

/* ============================================================
   TABLE PANEL (LEFT)
   ============================================================ */
.table-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  min-width: 0;
  overflow: hidden;
  background: var(--bg-primary);
}

.panel-header {
  height: 66px;
  min-height: 66px;
  max-height: 66px;
  padding: 0 20px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-secondary);
  flex-shrink: 0;
  overflow: visible;
  position: relative;
  z-index: 40;
}
.panel-header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  height: 100%;
}
.profile-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 24px;
  line-height: 24px;
}
.profile-title-row h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
  white-space: nowrap;
  line-height: 1;
}
.profile-badge {
  font-size: 10.5px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 5px;
  padding: 2px 7px;
  font-weight: 700;
  white-space: nowrap;
}
.profile-meta-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 22px;
  margin-top: 2px;
  white-space: nowrap;
  flex-wrap: nowrap;
}
.profile-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
  line-height: 1.2;
}

.panel-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Subtype Filter (e.g. Plat Hitam vs Bordes) */
.subtype-filter-wrap {
  padding: 6px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.subtype-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}
.subtype-btn {
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-muted);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.subtype-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-blue);
}
.subtype-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

/* Cross-Category Search Match Banner */
.cross-search-banner {
  padding: 7px 20px;
  background: rgba(59, 130, 246, 0.08);
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.cross-pills-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cross-pill-btn {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-primary);
  border: 1px solid var(--accent-blue);
  color: var(--accent-blue);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}
.cross-pill-btn:hover {
  background: var(--accent-blue);
  color: #fff;
}

/* View Toggle (Cat & Berat vs Inersia & Struktur) */
.view-toggle-wrap { display: flex; align-items: center; gap: 6px; }
.view-toggle-label { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.view-toggle {
  display: flex;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
}
.view-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 4px;
  transition: var(--transition);
  font-family: inherit;
}
.view-btn:hover { color: var(--text-primary); }
.view-btn.active {
  background: var(--accent-blue);
  color: white;
  box-shadow: 0 1px 4px rgba(59, 130, 246, 0.35);
}

.sort-controls { display: flex; align-items: center; gap: 5px; }
.sort-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.sort-btn {
  padding: 4px 8px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 3px;
}
.sort-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-arrow { font-size: 10px; opacity: 0.7; }

/* Table Scroll & Formatting */
.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.table-scroll::-webkit-scrollbar { width: 7px; height: 7px; }
.table-scroll::-webkit-scrollbar-track { background: var(--bg-primary); }
.table-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
}thead tr {
  height: 52px;
}

thead th {
  background: var(--th-bg);
  height: 52px;
  max-height: 52px;
  padding: 4px 6px;
  box-sizing: border-box;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  vertical-align: middle;
  overflow: hidden;
}
thead th.num {
  text-align: center;
  padding-right: 6px;
}
thead th:not(:last-child), tbody td:not(:last-child) {
  border-right: 1px solid var(--border-subtle);
}
thead th:hover { color: var(--text-primary); background: var(--bg-tertiary); }
thead th.sorted { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }

/* Stacked 2-line header & wrap layout (Centered & Consistent) */
.th-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  gap: 2px;
  min-width: 0;
  width: 100%;
}
thead th.num .th-wrap,
thead th:not(.num) .th-wrap {
  align-items: center;
  text-align: center;
}

.th-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.1;
  white-space: nowrap;
}
.th-title sub {
  font-size: 8px;
  text-transform: lowercase;
  font-weight: 600;
  line-height: 0;
  position: relative;
  bottom: -2px;
  vertical-align: baseline;
}

.th-sub {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-tertiary);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
}
thead th .sort-arrow {
  margin-left: 2px;
  font-size: 9px;
  opacity: 0.45;
  font-family: ui-monospace, monospace;
  transition: opacity 0.15s ease, color 0.15s ease;
}
thead th:hover .sort-arrow {
  opacity: 0.85;
}
thead th.sorted .sort-arrow {
  opacity: 1;
  color: var(--accent-blue);
  font-weight: 700;
}

.th-sub {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.15px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  line-height: 1.1;
  background: rgba(125, 125, 125, 0.08);
  padding: 1.5px 4.5px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  white-space: nowrap;
  transition: var(--transition);
}
thead th:hover .th-sub {
  color: var(--text-secondary);
  border-color: var(--border);
}
thead th.sorted .th-sub {
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  font-weight: 600;
}

tbody tr {
  transition: var(--transition);
  cursor: pointer;
}
tbody tr:nth-child(even) { background: var(--tr-even); }
tbody tr:hover { background: var(--bg-hover); }
tbody tr.selected {
  background: rgba(59, 130, 246, 0.16) !important;
  box-shadow: inset 3px 0 0 var(--accent-blue);
}
tbody tr.selected td:first-child { color: var(--accent-blue); font-weight: 700; }

tbody td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}
tbody td:first-child {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  min-width: 140px;
}
tbody td.num {
  text-align: right;
  padding-right: 11px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results svg { margin-bottom: 10px; stroke: var(--text-muted); }
.no-results p { font-size: 14px; font-weight: 500; color: var(--text-secondary); }

/* ============================================================
   RIGHT PANEL (Diagram, Props, Calculator)
   ============================================================ */
.right-panel {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  background: var(--bg-secondary);
}
.right-panel::-webkit-scrollbar { width: 6px; }
.right-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* --- Diagram Card --- */
.diagram-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.diagram-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.diagram-card-header h3 { font-size: 13.5px; font-weight: 700; color: var(--text-primary); }
.diagram-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

.diagram-wrap {
  background: #040d18;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 0 6px rgba(0, 0, 0, 0.35);
}
.diagram-wrap::after {
  display: none !important;
}
[data-theme="light"] .diagram-wrap,
[data-theme="light"] .props-modal-diagram-wrap,
[data-theme="light"] .compare-svg-wrap {
  background: #f8fafc !important;
  border: 1px solid rgba(148, 163, 184, 0.45) !important;
  box-shadow: inset 0 2px 8px rgba(100, 116, 139, 0.22), inset 0 0 4px rgba(100, 116, 139, 0.12) !important;
}
[data-theme="light"] .diagram-wrap::after {
  display: none !important;
}
[data-theme="light"] .diagram-wrap svg path[stroke="#38bdf8"],
[data-theme="light"] .diagram-wrap svg line[stroke="#38bdf8"],
[data-theme="light"] .diagram-wrap svg circle[stroke="#38bdf8"],
[data-theme="light"] .diagram-wrap svg rect[stroke="#38bdf8"],
[data-theme="light"] .diagram-wrap svg polygon[stroke="#38bdf8"],
[data-theme="light"] .props-modal-diagram-wrap svg path[stroke="#38bdf8"],
[data-theme="light"] .props-modal-diagram-wrap svg line[stroke="#38bdf8"],
[data-theme="light"] .props-modal-diagram-wrap svg circle[stroke="#38bdf8"],
[data-theme="light"] .props-modal-diagram-wrap svg rect[stroke="#38bdf8"],
[data-theme="light"] .props-modal-diagram-wrap svg polygon[stroke="#38bdf8"],
[data-theme="light"] .compare-svg-wrap svg path[stroke="#38bdf8"],
[data-theme="light"] .compare-svg-wrap svg line[stroke="#38bdf8"],
[data-theme="light"] .compare-svg-wrap svg circle[stroke="#38bdf8"],
[data-theme="light"] .compare-svg-wrap svg rect[stroke="#38bdf8"],
[data-theme="light"] .compare-svg-wrap svg polygon[stroke="#38bdf8"] {
  stroke: #0284c7;
}

/* Thicker solid profile contours for maximum contrast and solid appearance */
.diagram-wrap svg path[fill*="steel-hatch"],
.diagram-wrap svg polygon[fill*="steel-hatch"],
.diagram-wrap svg rect[fill*="steel-hatch"],
.diagram-wrap svg circle[fill*="steel-hatch"],
.props-modal-diagram-wrap svg path[fill*="steel-hatch"],
.props-modal-diagram-wrap svg polygon[fill*="steel-hatch"],
.props-modal-diagram-wrap svg rect[fill*="steel-hatch"],
.props-modal-diagram-wrap svg circle[fill*="steel-hatch"],
.compare-svg-wrap svg path[fill*="steel-hatch"],
.compare-svg-wrap svg polygon[fill*="steel-hatch"],
.compare-svg-wrap svg rect[fill*="steel-hatch"],
.compare-svg-wrap svg circle[fill*="steel-hatch"] {
  stroke-width: 2.2px !important;
}

#sectionSvg {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 360 / 240;
  display: block;
  cursor: pointer;
  border-radius: 8px;
  transition: opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1), transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center center;
}
#sectionSvg.diagram-animating {
  opacity: 0;
  transform: scale(0.96);
}
#sectionSvg:hover:not(.diagram-animating) {
  transform: scale(1.015);
}
.diagram-tip {
  font-size: 11px;
  text-align: center;
  color: var(--text-muted);
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Props Card --- */
.props-card {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.props-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.props-card-header h3 { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.active-profile-name { font-size: 11px; color: var(--accent-blue); font-weight: 600; }
.props-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.prop-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  transition: var(--transition);
}
.prop-item:hover { border-color: var(--border); }
.prop-label { font-size: 10px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.prop-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
  font-variant-numeric: tabular-nums;
}
.prop-unit { font-size: 10px; color: var(--text-muted); font-weight: normal; margin-left: 2px; }
.prop-item.highlight .prop-value { color: var(--accent-blue); }
.prop-item.highlight-amber .prop-value { color: var(--accent-amber); }

/* --- Calculator Card --- */
.calc-card {
  padding: 16px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.calc-header { margin-bottom: 12px; }
.calc-title { display: flex; align-items: center; gap: 8px; }
.calc-title svg { stroke: var(--accent-blue); }
.calc-title h3 { font-size: 13px; font-weight: 700; }

.calc-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-group { display: flex; flex-direction: column; gap: 4px; }
.form-group label { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.form-group input {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  width: 100%;
}
.form-group input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.calc-result-box {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calc-metric-group {
  display: flex;
  flex-direction: column;
}
.calc-metric-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 3px;
  padding-bottom: 2px;
}
.calc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.calc-dot.dot-blue { background: var(--accent-blue); box-shadow: 0 0 6px var(--accent-blue); }
.calc-dot.dot-amber { background: var(--accent-amber); box-shadow: 0 0 6px var(--accent-amber); }
.result-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
}
.r-label { font-size: 11.5px; color: var(--text-muted); }
.r-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}
.result-line.total-line { padding: 4px 0; }
.r-val.big { font-size: 17px; color: var(--accent-blue); font-weight: 700; }
.r-val.big.amber { color: var(--accent-amber); }
.r-val.big small { font-size: 11px; color: var(--text-secondary); font-weight: 500; }
.r-val.teal { color: var(--accent-teal); }
.result-line-divider { height: 1px; background: var(--border-subtle); margin: 6px 0; }

.btn-add-list {
  width: 100%;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px;
  color: white;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
}
.btn-add-list:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
}
.btn-add-list:active { transform: translateY(0); }

/* --- Rekap Daftar Kebutuhan --- */
.calc-list-card {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.calc-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.list-title-row { display: flex; align-items: center; gap: 8px; }
.list-title-row h3 { font-size: 13px; font-weight: 700; }
.list-badge {
  font-size: 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 1px 6px;
  border-radius: 10px;
}
.btn-clear-list {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition);
}
.btn-clear-list:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.calc-list-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.calc-list-item {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.calc-item-name { color: var(--text-primary); font-weight: 600; font-size: 12px; }
.calc-item-detail { color: var(--text-muted); font-size: 11px; margin-top: 1px; }
.calc-item-metric-row { display: flex; gap: 8px; align-items: center; }
.calc-item-weight {
  color: var(--accent-blue);
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.calc-item-paint {
  color: var(--accent-amber);
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}
.calc-item-del {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 13px;
  transition: var(--transition);
  margin-left: 6px;
}
.calc-item-del:hover { color: #f87171; background: rgba(239, 68, 68, 0.15); }

.empty-list {
  text-align: center;
  padding: 24px 10px;
  color: var(--text-muted);
}
.empty-list svg { stroke: var(--text-muted); margin-bottom: 6px; }
.empty-list p { font-size: 12px; color: var(--text-secondary); }
.empty-list small { font-size: 11px; }

/* Grand Total Bar */
.calc-total-bar {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.total-block { flex: 1; }
.total-block-divider { width: 1px; height: 32px; background: var(--border-subtle); }
.main-tot-lbl { font-size: 10.5px; font-weight: 600; color: var(--text-muted); display: block; text-transform: uppercase; letter-spacing: 0.3px; }
.total-val-box { margin-top: 2px; }
.total-kg { font-size: 16px; font-weight: 800; color: var(--accent-blue); font-family: 'JetBrains Mono', monospace; }
.total-paint { font-size: 16px; font-weight: 800; color: var(--accent-amber); font-family: 'JetBrains Mono', monospace; }
.unit-kg { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.total-ton { font-size: 11px; color: var(--accent-teal); margin-left: 4px; font-family: 'JetBrains Mono', monospace; }

/* ============================================================
   MODAL: SIDE-BY-SIDE COMPARISON
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  animation: scaleUp 0.2s ease;
}
@keyframes scaleUp { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary);
}
.modal-title-wrap { display: flex; align-items: center; gap: 10px; }
.modal-title-wrap svg { stroke: var(--accent-blue); }
.modal-title-wrap h2 { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.modal-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }

.modal-close-btn {
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close-btn:hover { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Compare Selectors */
.compare-selectors {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.selector-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.selector-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.selector-card label { font-size: 11px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; }
.selector-card.side-a label { color: var(--accent-blue); }
.selector-card.side-b label { color: var(--accent-teal); }

.compare-count-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  padding: 1px 6px;
  border-radius: 4px;
}

.selector-card-calc {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.selector-card-calc label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.compare-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.compare-search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
}
.compare-search-input,
.compare-search-wrap .compare-search-input,
.form-group .compare-search-wrap input.compare-search-input,
.selector-card .compare-search-wrap input.compare-search-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 28px 8px 34px !important;
  color: var(--text-primary);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  box-sizing: border-box;
}
.compare-search-input::placeholder { color: var(--text-muted); }
.compare-search-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
.compare-clear-btn {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  transition: var(--transition);
}
.compare-clear-btn:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.compare-dropdown {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}
.compare-dropdown optgroup {
  font-weight: 700;
  color: var(--accent-blue);
  background: var(--bg-secondary);
}
.compare-dropdown option {
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
}
.vs-badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

/* Compare Dual SVGs */
.compare-visual-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.compare-svg-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.svg-card-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.compare-svg-wrap {
  width: 100%;
  aspect-ratio: 360 / 240;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #040d18;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 8px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 0 6px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.compare-svg-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
}

/* Compare Table */
.compare-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  max-height: 210px;
  overflow-y: auto;
  overflow-x: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.compare-table-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.compare-table-wrap::-webkit-scrollbar-track {
  background: transparent;
}
.compare-table-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.compare-table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.compare-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--th-bg);
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  text-align: left;
}
.compare-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}
.compare-table tr:nth-child(even) { background: var(--tr-even); }
.diff-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}
.diff-badge.better {
  background: rgba(20, 184, 166, 0.15);
  color: var(--accent-teal);
  border: 1px solid rgba(20, 184, 166, 0.3);
}
.diff-badge.heavier {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}
.diff-badge.neutral {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Professional Engineering CAD/BIM HUD Toast Notification */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 20, 36, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 500;
  color: #f1f5f9;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  animation: toastInCenter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  letter-spacing: 0.01em;
}

[data-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #0f172a;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.toast-icon {
  flex-shrink: 0;
  color: #0284c7;
}

[data-theme="dark"] .toast-icon {
  color: #38bdf8;
}

.toast-icon.toast-icon-warning {
  color: #f59e0b !important;
}

.toast-msg {
  white-space: nowrap;
}

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

/* Responsive (Mobile & Tablet) */
@media (max-width: 980px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) auto 1fr;
    grid-template-areas:
      "header"
      "sidebar"
      "main";
    height: auto;
    overflow: visible;
  }
  .sidebar {
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-logo, .sidebar-section-label, .sidebar-divider, .sidebar-footer { display: none; }
  .nav-list {
    flex-direction: row;
    overflow-x: auto;
    padding: 8px;
    gap: 6px;
  }
  .nav-item { white-space: nowrap; padding: 7px 12px; }
  .main-content {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }
  .table-panel { border-right: none; border-bottom: 1px solid var(--border); height: 480px; }
  .compare-visual-row { grid-template-columns: 1fr; }
}

/* ============================================================
   INFO POPOVER & REFERENCE STANDARDS
   ============================================================ */
.btn-info-popover {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 12px;
  padding: 1px 8px;
  height: 20px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.btn-info-popover:hover {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
  color: #fff;
}
.info-popover-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.info-popover-box {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 440px;
  max-width: min(440px, calc(100vw - 32px));
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px var(--border);
  z-index: 1000;
  padding: 16px 18px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: normal !important;
  word-break: normal;
  overflow-wrap: break-word;
  box-sizing: border-box;
  animation: popoverFadeIn 0.15s ease-out;
}
.info-popover-box * {
  white-space: normal !important;
  word-break: normal;
  overflow-wrap: break-word;
}
.popover-body {
  white-space: normal !important;
  word-break: normal;
  overflow-wrap: break-word;
}
@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.popover-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 12px;
}
.popover-title {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent-blue);
  letter-spacing: -0.2px;
}
.popover-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: var(--transition);
}
.popover-close:hover { color: var(--text-primary); }

.popover-acronym-badge {
  display: inline-block;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
  white-space: normal !important;
}
.popover-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  white-space: normal !important;
  word-break: normal;
  overflow-wrap: break-word;
}

.popover-item {
  margin-bottom: 10px;
  white-space: normal !important;
}
.popover-item:last-child { margin-bottom: 0; }
.popover-label {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.popover-val {
  color: var(--text-primary);
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal !important;
  word-break: normal;
  overflow-wrap: break-word;
}
.popover-note {
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid var(--accent-blue);
  padding: 10px 12px;
  border-radius: 4px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: normal !important;
  word-break: normal;
  overflow-wrap: break-word;
}
.popover-note-title {
  font-weight: 700;
  color: var(--accent-blue);
  margin-bottom: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ============================================================
   PROPS DETAIL MODAL (DOUBLE CLICK)
   ============================================================ */

.props-modal-window {
  max-width: 980px;
  width: 95%;
  max-height: 92vh;
}
.props-modal-body {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  padding: 20px 24px;
  overflow: visible;
}
.props-modal-col-visual {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.props-modal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.props-modal-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--accent-blue);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}
.props-modal-info-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.props-modal-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.props-modal-standard {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.props-modal-diagram-wrap {
  background: #040d18;
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  padding: 8px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.45), inset 0 0 6px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 240px;
}
#propsModalSvg {
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 240;
  display: block;
  border-radius: 8px;
}
.props-modal-col-params {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.props-modal-params-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 2px;
}
.props-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
}
.props-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.props-modal-tip-esc {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.props-modal-tip-esc kbd {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-compare-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--accent-blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-compare-action:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}
@media (max-width: 860px) {
  .props-modal-body {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Navigation Group Headers */
.nav-group-header {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  padding: 12px 10px 4px 10px;
  margin-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.nav-group-header:first-of-type {
  margin-top: 0;
  border-top: none;
  padding-top: 4px;
}

/* ============================================================
   App Switcher (9-Dot Ecosystem Menu)
   ============================================================ */
.app-switcher-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.app-switcher-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-sizing: border-box;
}
.app-switcher-btn:hover,
.app-switcher-btn.active {
  color: var(--accent-blue);
  background: var(--bg-hover);
  border-color: rgba(59, 130, 246, 0.45);
}
.app-switcher-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 330px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  animation: asFadeIn 0.16s ease-out;
}
.app-switcher-dropdown.show {
  display: flex;
}
@keyframes asFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.as-header {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
}
.as-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: var(--accent-teal);
  text-transform: uppercase;
}
.as-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.as-grid {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
  max-height: 380px;
  overflow-y: auto;
}
.as-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  border: 1px solid transparent;
}
.as-card:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}
.as-card-active {
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--accent-blue);
}
.as-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  border: 1px solid var(--border-subtle);
}
.as-card-body {
  flex: 1;
  min-width: 0;
}
.as-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.as-card-desc {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.as-badge-current {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: var(--accent-blue);
  text-transform: uppercase;
}
.as-badge-soon {
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  text-transform: uppercase;
}
.as-card-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.as-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-tertiary);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.3px;
}

/* ============================================================
   MODAL KALKULATOR STRUKTUR & REKAP BOQ
   ============================================================ */
.calc-modal-window {
  max-width: 1080px;
  width: 95vw;
}
.calc-modal-body {
  padding: 20px 26px;
}
.calc-modal-grid {
  display: grid;
  grid-template-columns: 370px 1fr;
  gap: 22px;
}
.calc-modal-card {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.calc-modal-card.h-full {
  height: 100%;
}
.calc-modal-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.18);
  border: 1px solid rgba(59, 130, 246, 0.35);
  color: var(--accent-blue);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.label-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.label-row-between label {
  margin-bottom: 0;
}
.active-cat-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.28);
  letter-spacing: 0.3px;
  font-family: var(--font-mono);
}
.input-with-presets {
  display: flex;
  gap: 6px;
  align-items: center;
}
.preset-btns {
  display: flex;
  gap: 4px;
}
.preset-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  transition: var(--transition);
}
.preset-btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}
.input-with-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.input-with-stepper input {
  flex: 1;
  text-align: center;
}
.stepper-btn {
  width: 32px;
  height: 34px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.stepper-btn:hover {
  background: var(--accent-blue);
  color: white;
  border-color: var(--accent-blue);
}
.modal-result-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: 2px;
}
.modal-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid rgba(59, 130, 246, 0.45);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
  transition: var(--transition);
  margin-top: 4px;
}
.modal-add-btn:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
  transform: translateY(-1px);
}
.modal-add-btn:active {
  transform: translateY(1px);
}
.rekap-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rekap-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.list-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-family: var(--font-mono);
}
.btn-clear-list {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 550;
  padding: 3px 8px;
  cursor: pointer;
  transition: var(--transition);
}
.btn-clear-list:hover {
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.4);
  background: rgba(244, 63, 94, 0.08);
}
.modal-rekap-table-wrap {
  flex: 1;
  min-height: 280px;
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}
.modal-rekap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: fixed;
}
.modal-rekap-table th {
  background: var(--bg-tertiary);
  padding: 8px 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
  white-space: nowrap;
}
.modal-rekap-table td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 12px;
  vertical-align: middle;
}
.modal-rekap-table td:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-family: var(--font-mono);
}
.modal-rekap-table tr:hover td {
  background: rgba(56, 189, 248, 0.05);
}
.empty-rekap-cell {
  text-align: center;
  padding: 48px 16px !important;
  color: var(--text-muted);
}
.modal-grand-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-top: auto;
}
.summary-metric {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 4px 6px;
  border-left: 2px solid transparent;
}
.summary-metric:nth-child(1) { border-left-color: var(--text-muted); }
.summary-metric:nth-child(2) { border-left-color: var(--accent-blue); }
.summary-metric:nth-child(3) { border-left-color: var(--accent-amber); }
.summary-metric .metric-lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.summary-metric .metric-val {
  font-size: 14.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-primary);
  letter-spacing: -0.2px;
}
.summary-metric .metric-val.text-blue { color: var(--accent-blue); }
.summary-metric .metric-val.text-amber { color: var(--accent-amber); }
.summary-metric .metric-val.text-teal { color: var(--accent-teal); }

/* ============================================================
   MODAL PANDUAN SHORTCUT KEYBOARD
   ============================================================ */
.help-modal-window {
  max-width: 660px;
  width: 95vw;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.shortcut-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.shortcut-item:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.03);
}
.shortcut-keys {
  display: flex;
  align-items: center;
  gap: 4px;
}
.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  background: var(--bg-secondary);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  flex-shrink: 0;
}
.shortcut-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.shortcut-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.shortcut-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}
@media (max-width: 640px) {
  .calc-modal-grid { grid-template-columns: 1fr; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .modal-grand-summary { grid-template-columns: repeat(2, 1fr); }
}
