    /* --- PREMIUM ENTERPRISE DESIGN SYSTEM v7.0 --- */
    /* Typography: DM Sans (body) + Instrument Serif (display) + JetBrains Mono (code) */
    @import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;600&display=swap');
    
    :root {
      /* Typography - Premium Enterprise */
      --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
      --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
      
      /* Light theme - Refined Warm Slate */
      --bg-primary: #ffffff;
      --bg-secondary: #f7f8fa;
      --bg-tertiary: #eef0f4;
      --bg-hover: #e4e7ec;
      --bg-selected: #fff6f4;
      --bg-holding: #fefbf3;
      --bg-glass: rgba(255, 255, 255, 0.85);
      --bg-elevated: #ffffff;
      
      /* Text - Warmer, more refined */
      --text-primary: #1c1f26;
      --text-secondary: #4a5568;
      --text-muted: #718096;
      --text-inverse: #ffffff;
      
      /* Borders - Softer */
      --border-color: #e2e6ec;
      --border-light: #f0f2f5;
      --border-focus: #d95734;
      
      /* Accent colors - Manola Terracotta (warmer, more premium) */
      --accent-primary: #c9512f;
      --accent-primary-hover: #b5462a;
      --accent-primary-light: #fef5f3;
      --accent-primary-gradient: linear-gradient(135deg, #e06844 0%, #c9512f 50%, #a84427 100%);
      --accent-primary-glow: rgba(201, 81, 47, 0.12);
      
      /* Secondary accent - Deep navy for contrast */
      --accent-secondary: #1e3a5f;
      --accent-secondary-light: #f0f4f8;
      
      /* Status colors - Refined, less saturated */
      --accent-success: #0d9668;
      --accent-success-light: #ecfdf5;
      --accent-warning: #d97706;
      --accent-warning-light: #fffbeb;
      --accent-danger: #dc2626;
      --accent-danger-light: #fef2f2;
      --accent-info: #4f46e5;
      --accent-info-light: #eef2ff;
      
      /* Aliases for compatibility */
      --danger: var(--accent-danger);
      --success: var(--accent-success);
      --text-tertiary: var(--text-muted);
      --input-bg: var(--bg-primary);
      --panel-bg: var(--bg-tertiary);
      
      /* Premium shadows - More refined, warmer */
      --shadow-xs: 0 1px 2px rgba(28, 31, 38, 0.04);
      --shadow-sm: 0 1px 3px rgba(28, 31, 38, 0.05), 0 1px 2px rgba(28, 31, 38, 0.03);
      --shadow-md: 0 4px 8px -2px rgba(28, 31, 38, 0.08), 0 2px 4px -2px rgba(28, 31, 38, 0.04);
      --shadow-lg: 0 12px 24px -4px rgba(28, 31, 38, 0.1), 0 4px 8px -2px rgba(28, 31, 38, 0.04);
      --shadow-xl: 0 24px 48px -8px rgba(28, 31, 38, 0.12), 0 12px 24px -4px rgba(28, 31, 38, 0.06);
      --shadow-2xl: 0 32px 64px -12px rgba(28, 31, 38, 0.18);
      --shadow-inner: inset 0 2px 4px rgba(28, 31, 38, 0.04);
      --shadow-glow: 0 0 0 3px var(--accent-primary-glow);
      --shadow-card: 0 1px 3px rgba(28, 31, 38, 0.04), 0 1px 2px rgba(28, 31, 38, 0.02), 0 0 0 1px rgba(28, 31, 38, 0.03);
      --shadow-card-hover: 0 12px 28px rgba(28, 31, 38, 0.1), 0 4px 12px rgba(28, 31, 38, 0.04);
      --shadow-float: 0 20px 40px -8px rgba(28, 31, 38, 0.15), 0 8px 16px -4px rgba(28, 31, 38, 0.08);
      
      /* Spacing - Slightly more generous */
      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 14px;
      --radius-xl: 18px;
      --radius-2xl: 24px;
      --radius-full: 9999px;
      
      /* Transitions - Smoother, more refined */
      --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
      --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
      --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
      --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
      --transition-spring: 600ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
      
      /* Premium extras */
      --grain-opacity: 0.03;
      --glass-blur: 12px;
    }

    [data-theme="dark"] {
      /* Dark theme - Deep charcoal with warmth */
      --bg-primary: #13151a;
      --bg-secondary: #1a1d24;
      --bg-tertiary: #22262f;
      --bg-hover: #2d323d;
      --bg-selected: #362420;
      --bg-holding: #2d2618;
      --bg-glass: rgba(19, 21, 26, 0.9);
      --bg-elevated: #1e2128;
      
      --text-primary: #f4f5f7;
      --text-secondary: #9ca3af;
      --text-muted: #6b7280;
      
      --border-color: #2d323d;
      --border-light: #22262f;
      
      --accent-primary: #e8734f;
      --accent-primary-hover: #f08563;
      --accent-primary-light: #362420;
      --accent-primary-gradient: linear-gradient(135deg, #f08563 0%, #e8734f 50%, #d4643f 100%);
      --accent-primary-glow: rgba(232, 115, 79, 0.15);
      
      --accent-secondary: #60a5fa;
      --accent-secondary-light: #1e3a5f;
      
      --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
      --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
      --shadow-md: 0 4px 8px -2px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
      --shadow-lg: 0 12px 24px -4px rgba(0, 0, 0, 0.45), 0 4px 8px -2px rgba(0, 0, 0, 0.25);
      --shadow-xl: 0 24px 48px -8px rgba(0, 0, 0, 0.5), 0 12px 24px -4px rgba(0, 0, 0, 0.3);
      --shadow-glow: 0 0 0 3px var(--accent-primary-glow);
      --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03);
      --shadow-card-hover: 0 12px 28px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
      --shadow-float: 0 20px 40px -8px rgba(0, 0, 0, 0.5), 0 8px 16px -4px rgba(0, 0, 0, 0.35);
      
      --grain-opacity: 0.04;
    }

    /* --- RESET & BASE --- */
    *, *::before, *::after {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: var(--font-sans);
      font-size: 14px;
      line-height: 1.6;
      height: 100vh;
      display: flex;
      flex-direction: column;
      background: var(--bg-secondary);
      color: var(--text-primary);
      transition: background-color var(--transition-normal), color var(--transition-normal);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      letter-spacing: -0.01em;
      position: relative;
    }
    
    /* Subtle grain texture overlay for premium feel */
    body::before {
      content: '';
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
      z-index: 9999;
      opacity: var(--grain-opacity);
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    }

    /* --- HEADER - Premium Enterprise --- */
    header {
      padding: 0 28px;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: var(--bg-primary);
      height: 60px;
      flex-shrink: 0;
      position: relative;
      backdrop-filter: blur(var(--glass-blur));
    }
    
    header::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--accent-primary-gradient);
      opacity: 0.9;
    }
    
    header::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 0;
      right: 0;
      height: 1px;
      background: linear-gradient(90deg, transparent 0%, var(--border-color) 15%, var(--border-color) 85%, transparent 100%);
    }

    header .title {
      font-family: var(--font-display);
      font-weight: 400;
      font-size: 1.35rem;
      color: var(--text-primary);
      letter-spacing: -0.02em;
      font-style: italic;
    }

    header .title-area {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    header .logo {
      height: 32px;
      width: auto;
      display: block;
      filter: drop-shadow(0 1px 2px rgba(0,0,0,0.08));
      transition: transform var(--transition-fast);
    }
    
    header .logo:hover {
      transform: scale(1.02);
    }

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

    header .controls input[type="search"] {
      padding: 10px 16px 10px 40px;
      font-size: 0.8125rem;
      font-family: var(--font-sans);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      background: var(--bg-primary);
      color: var(--text-primary);
      width: 220px;
      transition: all var(--transition-fast);
      box-shadow: var(--shadow-inner);
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b929d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cpath d='m21 21-4.3-4.3'%3E%3C/path%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: 12px center;
      background-size: 14px;
    }

    header .controls input[type="search"]:focus {
      outline: none;
      background-color: var(--bg-primary);
      border-color: var(--accent-primary);
      box-shadow: var(--shadow-glow), var(--shadow-inner);
    }

    header .controls input[type="search"]::placeholder {
      color: var(--text-muted);
    }

    /* --- MAIN LAYOUT --- */
    main {
      flex: 1;
      display: grid;
      grid-template-columns: 42% 58%;
      overflow: hidden;
      background: var(--bg-secondary);
    }

    .left-panel {
      border-right: 1px solid var(--border-color);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
      box-shadow: inset -1px 0 0 rgba(0,0,0,0.02);
    }
    
    [data-theme="dark"] .left-panel {
      background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
      box-shadow: inset -1px 0 0 rgba(255,255,255,0.02);
    }

    .right-panel {
      padding: 0;
      overflow: auto;
      background: var(--bg-secondary);
    }
    
    .right-panel .tab-container {
      background: var(--bg-primary);
    }
    
    .right-panel .tab-content {
      padding: 24px 28px;
    }
    
    /* Professional Panel Headers */
    .panel-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 16px 24px;
      background: var(--bg-primary);
      border-bottom: 1px solid var(--border-color);
      box-shadow: var(--shadow-xs);
    }
    
    .panel-header h2 {
      margin: 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }
    
    .panel-header h2 svg {
      width: 18px;
      height: 18px;
      opacity: 0.6;
    }

    h2 {
      margin: 0 0 12px 0;
      font-family: var(--font-sans);
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 0.08em;
    }

    h3 {
      margin: 20px 0 12px 0;
      font-family: var(--font-display);
      font-size: 1.1rem;
      font-weight: 400;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }

    h4 {
      margin: 16px 0 10px 0;
      font-size: 0.6875rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.06em;
    }

    /* --- TABS - Premium Enterprise --- */
    .tab-container {
      margin-top: 0;
      background: var(--bg-primary);
    }

    .tab-buttons {
      display: flex;
      gap: 0;
      border-bottom: 1px solid var(--border-color);
      padding: 0 28px;
      background: var(--bg-primary);
      flex-wrap: wrap;
    }

    .tab-btn {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 16px 20px;
      border: none;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      font-size: 0.8125rem;
      font-weight: 500;
      transition: all var(--transition-fast);
      position: relative;
      letter-spacing: -0.005em;
    }
    
    .tab-btn svg {
      width: 16px;
      height: 16px;
      opacity: 0.5;
      transition: all var(--transition-fast);
    }

    .tab-btn:hover {
      color: var(--text-primary);
      background: var(--bg-secondary);
    }
    
    [data-theme="dark"] .tab-btn:hover {
      background: rgba(255,255,255,0.03);
    }
    
    .tab-btn:hover svg {
      opacity: 0.8;
    }

    .tab-btn.active {
      color: var(--accent-primary);
      font-weight: 600;
    }
    
    .tab-btn.active svg {
      opacity: 1;
    }

    .tab-btn.active::after {
      content: '';
      position: absolute;
      bottom: -1px;
      left: 12px;
      right: 12px;
      height: 2px;
      background: var(--accent-primary);
      border-radius: 2px 2px 0 0;
    }

    .tab-content {
      display: none;
      padding: 24px 28px;
    }

    .tab-content.active {
      display: block;
    }

    /* --- TREE --- */
    .tree {
      border: none;
      border-radius: 0;
      padding: 4px 0;
      background: var(--bg-primary);
      overflow: auto;
      flex: 1;
      font-size: 0.8125rem;
    }

    .holding {
      background: linear-gradient(180deg, rgba(234, 179, 8, 0.08) 0%, var(--bg-primary) 100%);
    }
    
    [data-theme="dark"] .holding {
      background: linear-gradient(180deg, rgba(234, 179, 8, 0.12) 0%, var(--bg-primary) 100%);
    }

    .tree-row {
      display: flex;
      align-items: center;
      padding: 5px 16px;
      cursor: default;
      user-select: none;
      white-space: nowrap;
      border-radius: 0;
      transition: all var(--transition-fast);
      min-height: 32px;
      border-left: 3px solid transparent;
      position: relative;
    }
    
    .tree-row:hover {
      background: var(--bg-hover);
    }
    
    /* FLOC (Functional Location) visual distinction */
    .tree-row.is-floc {
      background: linear-gradient(90deg, rgba(55, 65, 81, 0.05) 0%, transparent 40%);
      border-left-color: #374151 !important;
    }
    .tree-row.is-floc:hover {
      background: linear-gradient(90deg, rgba(55, 65, 81, 0.1) 0%, var(--bg-hover) 40%);
    }
    .tree-row.is-floc .tree-label .tag {
      color: #374151;
      font-weight: 600;
    }
    [data-theme="dark"] .tree-row.is-floc {
      background: linear-gradient(90deg, rgba(156, 163, 175, 0.08) 0%, transparent 40%);
      border-left-color: #9ca3af !important;
    }
    [data-theme="dark"] .tree-row.is-floc .tree-label .tag {
      color: #d1d5db;
    }
    
    /* Equipment rows get blue border by default, overridden by criticality */
    .tree-row:not(.is-floc):not(.crit-border-A):not(.crit-border-B):not(.crit-border-C) {
      border-left-color: #3b82f6;
    }
    [data-theme="dark"] .tree-row:not(.is-floc):not(.crit-border-A):not(.crit-border-B):not(.crit-border-C) {
      border-left-color: #60a5fa;
    }
    
    /* Criticality left border indicator */
    .tree-row.crit-border-A {
      border-left-color: var(--accent-danger);
    }
    .tree-row.crit-border-B {
      border-left-color: var(--accent-warning);
    }
    .tree-row.crit-border-C {
      border-left-color: var(--accent-success);
    }
    .tree-row.crit-border-U {
      border-left-color: #3b82f6;
    }
    [data-theme="dark"] .tree-row.crit-border-U {
      border-left-color: #60a5fa;
    }
    
    /* Selection Counter Pill - Premium floating design */
    .selection-counter {
      position: fixed;
      bottom: 28px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--accent-primary-gradient);
      color: white;
      padding: 10px 20px;
      border-radius: var(--radius-full);
      font-size: 0.85rem;
      font-weight: 600;
      box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.1);
      z-index: 1000;
      display: none;
      align-items: center;
      gap: 14px;
      animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .selection-counter.visible {
      display: flex;
    }
    .selection-counter .count {
      background: rgba(255,255,255,0.2);
      padding: 2px 8px;
      border-radius: 10px;
    }
    .selection-counter .actions {
      display: flex;
      gap: 4px;
    }
    .selection-counter .actions button {
      background: rgba(255,255,255,0.2);
      border: none;
      color: white;
      padding: 4px 10px;
      border-radius: 4px;
      font-size: 0.8rem;
      cursor: pointer;
      transition: background 0.15s;
    }
    .selection-counter .actions button:hover {
      background: rgba(255,255,255,0.35);
    }
    @keyframes slideUp {
      from { transform: translateX(-50%) translateY(20px); opacity: 0; }
      to { transform: translateX(-50%) translateY(0); opacity: 1; }
    }
    
    /* Quick Filter Chips */
    .filter-chips {
      display: flex;
      gap: 6px;
      flex-wrap: wrap;
      align-items: center;
    }
    .filter-chip {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 10px;
      border-radius: 16px;
      font-size: 0.75rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.15s ease;
      border: 1px solid var(--border-color);
      background: var(--bg-primary);
      color: var(--text-secondary);
    }
    .filter-chip:hover {
      border-color: var(--accent-primary);
      color: var(--accent-primary);
    }
    .filter-chip.active {
      background: var(--accent-primary);
      border-color: var(--accent-primary);
      color: white;
    }
    .filter-chip .chip-count {
      background: rgba(0,0,0,0.1);
      padding: 1px 5px;
      border-radius: 8px;
      font-size: 0.7rem;
    }
    .filter-chip.active .chip-count {
      background: rgba(255,255,255,0.25);
    }
    .filter-chip-divider {
      width: 1px;
      height: 20px;
      background: var(--border-color);
      margin: 0 4px;
    }
    
    /* Grid/Spreadsheet View Styles */
    .grid-header {
      position: relative;
      transition: background 0.15s;
    }
    .grid-header:hover {
      background: var(--bg-hover) !important;
    }
    .grid-header.sorted-asc .sort-icon::after {
      content: ' ▲';
      font-size: 0.7rem;
      color: var(--accent-primary);
    }
    .grid-header.sorted-desc .sort-icon::after {
      content: ' ▼';
      font-size: 0.7rem;
      color: var(--accent-primary);
    }
    .grid-header:not(.sorted-asc):not(.sorted-desc):hover .sort-icon::after {
      content: ' ▲';
      font-size: 0.7rem;
      color: var(--text-muted);
      opacity: 0.5;
    }
    .grid-filter {
      color: var(--text-primary);
    }
    .grid-filter:focus {
      outline: none;
      border-color: var(--accent-primary) !important;
      box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
    }
    .grid-filter.active {
      background: var(--accent-primary-light) !important;
      border-color: var(--accent-primary) !important;
    }
    #gridTableBody tr:hover {
      background: var(--bg-hover);
    }
    #gridTableBody tr.selected {
      background: var(--accent-primary-light);
    }
    
    /* --- ORG CHART --- */
    .orgchart-wrapper {
      position: relative;
      overflow: auto;
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      height: calc(100vh - 320px);
      min-height: 400px;
      cursor: grab;
    }
    
    .orgchart-wrapper:active {
      cursor: grabbing;
    }
    
    .orgchart-container {
      display: inline-block;
      padding: 40px;
      min-width: 100%;
      transform-origin: top left;
      transition: transform 0.1s ease-out;
    }
    
    .orgchart-level {
      display: flex;
      justify-content: center;
      align-items: flex-start;
      gap: 20px;
      margin-bottom: 0;
      position: relative;
    }
    
    .orgchart-node-wrapper {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    
    .orgchart-node {
      min-width: 140px;
      max-width: 180px;
      padding: 10px 14px;
      background: var(--bg-primary);
      border: 2px solid var(--border-color);
      border-radius: var(--radius-md);
      text-align: center;
      cursor: pointer;
      transition: all 0.15s;
      box-shadow: 0 2px 4px rgba(0,0,0,0.05);
      position: relative;
    }
    
    .orgchart-node:hover {
      border-color: var(--accent-primary);
      box-shadow: 0 4px 12px rgba(0,0,0,0.1);
      transform: translateY(-2px);
    }
    
    .orgchart-node.selected {
      border-color: var(--accent-warning);
      box-shadow: 0 0 0 3px var(--accent-warning-light);
    }
    
    .orgchart-node.floc {
      border-left: 4px solid #374151;
    }
    
    .orgchart-node.equip {
      border-left: 4px solid #2563eb;
    }
    
    [data-theme="dark"] .orgchart-node.floc {
      border-left-color: #9ca3af;
    }
    
    [data-theme="dark"] .orgchart-node.equip {
      border-left-color: #60a5fa;
    }
    
    .orgchart-node-tag {
      font-weight: 600;
      font-size: 0.85rem;
      color: var(--text-primary);
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .orgchart-node-name {
      font-size: 0.7rem;
      color: var(--text-secondary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    
    .orgchart-node-badge {
      position: absolute;
      top: -8px;
      right: -8px;
      background: var(--accent-primary);
      color: white;
      font-size: 0.65rem;
      font-weight: 600;
      padding: 2px 6px;
      border-radius: 10px;
      min-width: 18px;
      text-align: center;
    }
    
    .orgchart-children {
      display: flex;
      justify-content: center;
      gap: 20px;
      margin-top: 30px;
      position: relative;
    }
    
    .orgchart-children::before {
      content: '';
      position: absolute;
      top: -15px;
      left: 50%;
      width: 2px;
      height: 15px;
      background: var(--border-color);
    }
    
    .orgchart-children.multiple::after {
      content: '';
      position: absolute;
      top: -15px;
      height: 2px;
      background: var(--border-color);
    }
    
    .orgchart-node-wrapper .orgchart-connector {
      width: 2px;
      height: 15px;
      background: var(--border-color);
    }
    
    .orgchart-breadcrumb {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 8px 12px;
      background: var(--bg-tertiary);
      border-radius: var(--radius-md);
      margin-bottom: 12px;
      font-size: 0.8rem;
      overflow-x: auto;
    }
    
    .orgchart-breadcrumb-item {
      color: var(--text-secondary);
      cursor: pointer;
      white-space: nowrap;
    }
    
    .orgchart-breadcrumb-item:hover {
      color: var(--accent-primary);
    }
    
    .orgchart-breadcrumb-item.current {
      color: var(--text-primary);
      font-weight: 600;
    }
    
    .orgchart-breadcrumb-sep {
      color: var(--text-muted);
    }
    
    .orgchart-legend {
      display: flex;
      gap: 20px;
      justify-content: center;
      margin-top: 12px;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }
    
    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    
    .legend-color {
      width: 14px;
      height: 14px;
      border-radius: 3px;
    }
    
    .legend-color.legend-border {
      background: transparent;
      border: 2px solid;
    }
    
    .orgchart-empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 300px;
      color: var(--text-muted);
    }
    
    .orgchart-empty-icon {
      font-size: 3rem;
      margin-bottom: 12px;
      opacity: 0.5;
    }
    
    /* Incomplete item indicator */
    .tree-row.incomplete {
      background: linear-gradient(90deg, var(--accent-warning-light) 0%, transparent 40%);
    }
    
    [data-theme="dark"] .tree-row.incomplete {
      background: linear-gradient(90deg, rgba(234, 179, 8, 0.15) 0%, transparent 40%);
    }

    .tree-row:hover {
      background: var(--bg-tertiary);
    }
    
    .tree-row.incomplete:hover {
      background: var(--bg-tertiary);
    }

    .tree-row.selected {
      background: var(--accent-primary-light);
    }
    
    [data-theme="dark"] .tree-row.selected {
      background: rgba(37, 99, 235, 0.2);
    }

    .tree-row.match {
      background: var(--accent-primary-light);
      box-shadow: inset 3px 0 0 var(--accent-primary);
    }

    .tree-toggle {
      width: 18px;
      height: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 2px;
      cursor: pointer;
      font-weight: 500;
      font-size: 10px;
      color: var(--text-muted);
      border-radius: var(--radius-sm);
      transition: all var(--transition-fast);
      flex-shrink: 0;
    }

    .tree-toggle:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
    }

    .tree-toggle.placeholder {
      visibility: hidden;
    }

    .tree-label {
      display: flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
    }

    .tree-label .tag {
      font-weight: 500;
      font-family: var(--font-mono);
      font-size: 0.75rem;
      color: var(--text-primary);
    }

    .tree-label .name {
      color: var(--text-secondary);
      font-weight: 400;
    }

    .tree-label .sep {
      color: var(--text-muted);
      margin: 0 2px;
    }

    .warning {
      color: var(--accent-danger);
      margin-right: 4px;
    }

    .duplicate .tag {
      color: var(--accent-danger);
    }

    .indent {
      display: inline-block;
      position: relative;
    }
    
    /* Tree connector lines */
    .tree-connector {
      position: absolute;
      left: 12px;
      top: 0;
      bottom: 0;
      width: 1px;
      background: var(--border-color);
    }
    
    .tree-branch {
      position: absolute;
      right: 4px;
      top: 50%;
      width: 10px;
      height: 1px;
      background: var(--border-color);
    }

    /* --- TYPE BADGE --- */
    .node-type {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-right: 6px;
      width: 18px;
      height: 18px;
    }
    .node-type svg {
      width: 16px;
      height: 16px;
    }
    .node-type-floc svg {
      color: #374151;
      fill: #374151;
    }
    .node-type-equip svg {
      color: #2563eb;
      fill: #2563eb;
    }

    [data-theme="dark"] .node-type-floc svg {
      color: #9ca3af;
      fill: #9ca3af;
    }
    [data-theme="dark"] .node-type-equip svg {
      color: #60a5fa;
      fill: #60a5fa;
    }

    /* --- CRITICALITY BADGE - Premium --- */
    .crit-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-left: 8px;
      padding: 3px 10px;
      border-radius: var(--radius-full);
      font-size: 0.65rem;
      font-weight: 600;
      letter-spacing: 0.03em;
      text-transform: uppercase;
      box-shadow: var(--shadow-xs);
    }
    .crit-A { 
      background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%); 
      color: white; 
      box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.2);
    }
    .crit-B { 
      background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%); 
      color: #451a03;
      box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.3);
    }
    .crit-C { 
      background: linear-gradient(135deg, #6ee7b7 0%, #10b981 100%); 
      color: white;
      box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255,255,255,0.2);
    }
    .crit-U { 
      background: var(--bg-tertiary); 
      color: var(--text-muted);
      box-shadow: none;
    }

    /* --- DEPTH BADGE --- */
    .depth-badge {
      display: inline-flex;
      align-items: center;
      margin-left: 8px;
      padding: 2px 7px;
      border-radius: var(--radius-full);
      font-size: 0.65rem;
      font-weight: 500;
      background: var(--bg-tertiary);
      color: var(--text-muted);
    }
    .depth-warning {
      background: var(--accent-warning-light);
      color: #92400e;
    }

    /* --- DATA QUALITY BADGE --- */
    .dq-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-left: 8px;

/* --- CRITICALITY CALCULATOR --- */
.crit-calculator {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0;
}

.crit-calculator summary {
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}

.crit-calculator[open] summary {
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 1px solid var(--border-color);
}

.crit-calc-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.crit-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.crit-calc-row label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  min-width: 120px;
}

.crit-calc-select {
  flex: 1;
  padding: 4px 8px;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
}

/* --- COLLECTION STATUS --- */
.collection-status-select {
  font-weight: 500;
}

.collection-status-select option[value=""] { color: var(--text-muted); }
.collection-status-select option[value="DESKTOP"] { color: #3b82f6; }
.collection-status-select option[value="FIELD_PENDING"] { color: #f59e0b; }
.collection-status-select option[value="FIELD_VERIFIED"] { color: #10b981; }
.collection-status-select option[value="FLAGGED"] { color: #ef4444; }
.collection-status-select option[value="APPROVED"] { color: #8b5cf6; }

/* Collection status indicator on tree rows */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  flex-shrink: 0;
}

.status-dot.desktop { background: #3b82f6; }
.status-dot.field-pending { background: #f59e0b; }
.status-dot.field-verified { background: #10b981; }
.status-dot.flagged { background: #ef4444; }
.status-dot.approved { background: #8b5cf6; }

/* --- SECE Indicator --- */
.sece-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #451a03;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  margin-left: 6px;
  letter-spacing: 0.05em;
}

.tree-row.is-sece {
  border-left: 3px solid #f59e0b;
}

/* --- CMMS Mapping Preview --- */
.mapping-preview {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.8rem;
}

.mapping-preview-table {
  width: 100%;
  border-collapse: collapse;
}

.mapping-preview-table th,
.mapping-preview-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.mapping-preview-table th {
  background: var(--bg-tertiary);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.mapping-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
}

.mapping-status.mapped { color: var(--accent-success); }
.mapping-status.unmapped { color: var(--accent-warning); }
.mapping-status.missing { color: var(--accent-danger); }
      padding: 3px 8px;
      border-radius: var(--radius-sm);
      font-size: 0.65rem;
      font-weight: 600;
      min-width: 38px;
      cursor: help;
      transition: transform var(--transition-fast);
    }
    .dq-badge:hover {
      transform: scale(1.05);
    }
    .dq-low {
      background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
      color: #b91c1c;
    }
    .dq-mid {
      background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
      color: #92400e;
    }
    .dq-high {
      background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
      color: #047857;
    }
    
    /* --- PROFESSIONAL CARD COMPONENT --- */
    .pro-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 16px;
      box-shadow: var(--shadow-card);
      transition: all var(--transition-fast);
    }
    
    .pro-card:hover {
      box-shadow: var(--shadow-card-hover);
      transform: translateY(-2px);
    }
    
    .pro-card-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;
      padding-bottom: 12px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .pro-card-title {
      font-size: 0.875rem;
      font-weight: 600;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }
    
    /* --- STAT CARD --- */
    .stat-card {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 16px 20px;
      box-shadow: var(--shadow-xs);
      text-align: center;
    }
    
    .stat-card-value {
      font-size: 1.75rem;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.02em;
      line-height: 1.2;
    }
    
    .stat-card-label {
      font-size: 0.75rem;
      font-weight: 500;
      color: var(--text-muted);
      margin-top: 4px;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    /* --- BUTTONS --- */
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 10px 18px;
      border-radius: var(--radius-md);
      border: 1px solid var(--border-color);
      background: var(--bg-primary);
      color: var(--text-primary);
      cursor: pointer;
      font-family: var(--font-sans);
      font-size: 0.8125rem;
      font-weight: 500;
      transition: all var(--transition-fast);
      box-shadow: var(--shadow-sm);
      position: relative;
      overflow: hidden;
      letter-spacing: -0.01em;
    }
    
    .btn::before {
      content: '';
      position: absolute;
      inset: 0;
      background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
      opacity: 0;
      transition: opacity var(--transition-fast);
    }

    .btn:hover {
      background: var(--bg-secondary);
      border-color: var(--accent-primary);
      color: var(--accent-primary);
      box-shadow: var(--shadow-md);
      transform: translateY(-1px);
    }
    
    .btn:hover::before {
      opacity: 1;
    }

    .btn:active {
      background: var(--bg-tertiary);
      transform: translateY(0);
      box-shadow: var(--shadow-inner);
    }

    .btn:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }

    .btn-primary {
      background: var(--accent-primary);
      border-color: transparent;
      color: white;
      box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.1);
    }

    .btn-primary:hover {
      background: var(--accent-primary-hover);
      border-color: transparent;
      color: white;
      box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.1);
      transform: translateY(-2px);
    }
    
    .btn-primary:active {
      background: var(--accent-primary-hover);
      box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
      transform: translateY(0);
    }

    .btn-small, .btn-sm {
      padding: 6px 12px;
      font-size: 0.75rem;
      border-radius: var(--radius-sm);
    }

    .btn-danger {
      background: var(--accent-danger);
      border-color: transparent;
      color: white;
      box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.1);
    }

    .btn-danger:hover {
      background: #dc2626;
      border-color: transparent;
      color: white;
      box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.1);
    }

    .btn-success {
      background: var(--accent-success);
      border-color: transparent;
      color: white;
      box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.1);
    }

    .btn-success:hover {
      background: #059669;
      border-color: transparent;
      color: white;
      box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.1);
    }
    
    .btn-ghost {
      background: transparent;
      border-color: transparent;
      box-shadow: none;
    }
    
    .btn-ghost:hover {
      background: var(--bg-hover);
      border-color: transparent;
      box-shadow: none;
    }

    .btn-group {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
    }

    .btn-separator {
      width: 1px;
      height: 20px;
      background: var(--border-color);
      margin: 0 4px;
    }
    
    /* --- ACTION SECTIONS - Professional Cards --- */
    .action-section {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 16px 18px;
      margin-bottom: 16px;
      box-shadow: var(--shadow-xs);
      transition: all var(--transition-fast);
    }
    
    .action-section:hover {
      box-shadow: var(--shadow-sm);
      border-color: var(--border-color);
    }
    
    .action-section h3 {
      margin: 0 0 12px 0;
      font-size: 0.8125rem;
      font-weight: 600;
      color: var(--text-primary);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .action-section h3::before {
      content: '';
      display: block;
      width: 4px;
      height: 16px;
      background: var(--accent-primary-gradient);
      border-radius: 2px;
    }
    
    .action-section p {
      margin: 8px 0 0 0;
      font-size: 0.75rem;
      color: var(--text-muted);
      line-height: 1.5;
    }
    
    .action-section .btn-group {
      margin-top: 4px;
    }
    
    /* Section variant - highlighted/primary */
    .action-section.primary {
      background: linear-gradient(135deg, var(--accent-primary-light) 0%, var(--bg-primary) 100%);
      border-color: rgba(217, 87, 52, 0.2);
    }
    
    /* Section variant - warning */
    .action-section.warning {
      background: linear-gradient(135deg, var(--accent-warning-light) 0%, var(--bg-primary) 100%);
      border-color: rgba(245, 158, 11, 0.2);
    }
    
    /* --- STATS ROW --- */
    .stats-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
      gap: 12px;
      margin-bottom: 20px;
    }
    
    .stat-item {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 14px 16px;
      text-align: center;
      box-shadow: var(--shadow-xs);
    }
    
    .stat-value {
      font-size: 1.5rem;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: -0.02em;
      line-height: 1.2;
    }
    
    .stat-label {
      font-size: 0.6875rem;
      font-weight: 500;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-top: 4px;
    }
    
    /* Status indicator dots */
    .status-dot {
      display: inline-block;
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-right: 6px;
    }
    
    .status-dot.success { background: var(--accent-success); }
    .status-dot.warning { background: var(--accent-warning); }
    .status-dot.danger { background: var(--accent-danger); }
    .status-dot.info { background: var(--accent-info); }
    
    /* --- STATUS BAR - Professional Footer --- */
    .status-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 20px;
      background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
      border-top: 1px solid var(--border-color);
      font-size: 0.6875rem;
      color: var(--text-muted);
      flex-shrink: 0;
    }
    
    .status-left, .status-right {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    
    .status-item {
      display: flex;
      align-items: center;
    }
    
    .status-divider {
      width: 1px;
      height: 12px;
      background: var(--border-color);
    }

    /* --- MODALS - Professional Enterprise --- */
    .modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.5);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 1000;
      animation: fadeIn 0.2s ease;
    }
    
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }
    
    @keyframes slideUp {
      from { opacity: 0; transform: translateY(20px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    [data-theme="dark"] .modal-backdrop {
      background: rgba(0, 0, 0, 0.7);
    }

    .modal {
      background: var(--bg-primary);
      color: var(--text-primary);
      border-radius: var(--radius-2xl);
      padding: 0;
      width: 560px;
      max-width: 95vw;
      max-height: 90vh;
      overflow: hidden;
      box-shadow: var(--shadow-float), 0 0 0 1px rgba(0,0,0,0.04);
      display: flex;
      flex-direction: column;
      animation: modalSlideIn 0.3s var(--transition-spring);
    }
    
    @keyframes modalSlideIn {
      from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
      }
      to {
        opacity: 1;
        transform: translateY(0) scale(1);
      }
    }
    
    /* Large landscape modal for asset details */
    .modal.modal-landscape {
      width: 95vw;
      max-width: 1400px;
      height: 85vh;
      max-height: 85vh;
    }
    
    .modal-landscape .modal-body {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 32px;
      padding: 28px 32px;
      overflow-y: auto;
    }
    
    /* Core tab uses full width */
    .modal-landscape .modal-body .modal-column:first-child {
      grid-column: span 1;
    }
    
    .modal-landscape .modal-body.core-tab-active {
      grid-template-columns: 1fr;
    }
    
    .modal-landscape .modal-body.core-tab-active .modal-column:first-child {
      max-width: 100%;
    }
    
    .modal-landscape .modal-column {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    
    .modal-landscape .modal-section {
      margin-bottom: 8px;
    }
    
    .modal-landscape .modal-section h4 {
      margin: 16px 0 12px 0;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border-light);
    }
    
    .modal-landscape .modal-section h4:first-child {
      margin-top: 0;
    }
    
    /* Responsive: stack columns on smaller screens */
    @media (max-width: 900px) {
      .modal.modal-landscape {
        width: 95vw;
        max-width: 95vw;
      }
      
      .modal-landscape .modal-body {
        grid-template-columns: 1fr;
      }
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 28px;
      border-bottom: 1px solid var(--border-color);
      background: var(--bg-primary);
      position: relative;
    }
    
    .modal-header::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 28px;
      right: 28px;
      height: 1px;
      background: linear-gradient(90deg, var(--accent-primary) 0%, transparent 100%);
      opacity: 0.3;
    }

    .modal-header h3 {
      margin: 0;
      font-family: var(--font-display);
      font-size: 1.15rem;
      font-weight: 400;
      color: var(--text-primary);
      letter-spacing: -0.01em;
    }

    .modal-header button {
      width: 34px;
      height: 34px;
      border: none;
      background: var(--bg-tertiary);
      color: var(--text-muted);
      cursor: pointer;
      font-size: 1.25rem;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--transition-fast);
    }

    .modal-header button:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
    }

    .modal-body {
      padding: 20px;
      overflow-y: auto;
      flex: 1;
    }

    .modal-footer {
      display: flex;
      justify-content: flex-end;
      gap: 8px;
      padding: 16px 20px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-secondary);
    }

    .modal-wide {
      width: 700px;
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
    }

    .modal-header h3 {
      margin: 0;
      font-size: 1rem;
    }

    .modal-header button {
      border: none;
      background: transparent;
      font-size: 1.1rem;
      cursor: pointer;
    }

    .modal-section {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px 16px;
      margin-bottom: 12px;
    }

    .modal-section h4 {
      grid-column: 1 / 3;
      margin: 8px 0 4px;
      font-size: 0.875rem;
      border-bottom: 1px solid var(--border-color);
    }
    
    /* Type toggle buttons */
    .type-toggle-btn {
      border: 2px solid var(--border-color) !important;
      background: var(--bg-primary) !important;
      color: var(--text-secondary);
    }
    .type-toggle-btn:hover {
      border-color: var(--accent-primary) !important;
      background: var(--bg-hover) !important;
    }
    .type-toggle-btn.active {
      border-color: var(--accent-primary) !important;
      background: var(--accent-primary-light) !important;
      color: var(--text-primary);
      font-weight: 600;
    }
    #typeLocBtn.active {
      border-color: #374151 !important;
      background: rgba(55, 65, 81, 0.1) !important;
    }
    #typeEquipBtn.active {
      border-color: #2563eb !important;
      background: rgba(37, 99, 235, 0.1) !important;
    }
    [data-theme="dark"] #typeLocBtn.active {
      border-color: #9ca3af !important;
      background: rgba(156, 163, 175, 0.2) !important;
    }
    [data-theme="dark"] #typeEquipBtn.active {
      border-color: #60a5fa !important;
      background: rgba(96, 165, 250, 0.2) !important;
    }

    .field-label {
      font-weight: 500;
      font-size: 0.8125rem;
      display: block;
      margin-bottom: 8px;
      color: var(--text-secondary);
      letter-spacing: -0.005em;
    }

    .field-input {
      width: 100%;
      box-sizing: border-box;
      padding: 11px 14px;
      font-size: 0.875rem;
      font-family: var(--font-sans);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      background: var(--bg-primary);
      color: var(--text-primary);
      transition: all var(--transition-fast);
      box-shadow: var(--shadow-xs);
    }

    .field-input:hover {
      border-color: var(--text-muted);
    }
    
    [data-theme="dark"] .field-input:hover {
      border-color: #4a5260;
    }

    .field-input:focus {
      outline: none;
      border-color: var(--accent-primary);
      box-shadow: var(--shadow-glow);
      background: var(--bg-primary);
    }

    .field-input::placeholder {
      color: var(--text-muted);
      opacity: 0.7;
    }
    
    /* Select dropdowns */
    select.field-input {
      cursor: pointer;
      padding-right: 40px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      background-size: 16px;
      appearance: none;
      -webkit-appearance: none;
    }

    .field-disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .field-hint {
      font-size: 0.75rem;
      color: var(--text-muted);
      margin-top: 6px;
      line-height: 1.4;
    }

    .field-error {
      color: var(--accent-danger);
      font-size: 0.75rem;
      margin-top: 6px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .field-warning {
      color: var(--accent-warning);
      font-size: 0.75rem;
      margin-top: 6px;
    }

    /* --- PROJECT TYPE OPTIONS --- */
    .project-type-option {
      transition: all var(--transition-fast);
      box-shadow: var(--shadow-sm);
      border-radius: var(--radius-md);
    }
    
    .project-type-option:hover {
      border-color: var(--accent-primary) !important;
      background: var(--bg-secondary) !important;
      box-shadow: var(--shadow-md);
      transform: translateY(-2px);
    }
    
    .project-type-option input[type="radio"] {
      accent-color: var(--accent-primary);
    }

    /* --- VALIDATION PANEL --- */
    .issues-panel {
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 12px;
      max-height: 240px;
      overflow: auto;
      font-size: 0.8125rem;
      background: var(--bg-primary);
      box-shadow: var(--shadow-sm);
    }

    .issue-item {
      padding: 8px;
      margin-bottom: 4px;
      cursor: pointer;
      border-radius: var(--radius-sm);
      transition: background-color var(--transition-fast);
    }

    .issue-item:hover {
      background: var(--bg-hover);
    }

    .issue-severity {
      font-weight: 600;
      margin-right: 6px;
      font-size: 0.75rem;
    }

    .issue-severity-error {
      color: var(--accent-danger);
    }

    .issue-severity-warning {
      color: #f0ad4e;
    }

    .issue-severity-info {
      color: #5bc0de;
    }

    /* --- STATS GRID --- */
    .stats-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 8px;
      margin-bottom: 12px;
    }

    .stat-card {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 8px;
      text-align: center;
    }

    .stat-value {
      font-size: 1.4rem;
      font-weight: 700;
      color: var(--accent-primary);
    }

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

    /* --- QUALITY SCORE CARD (Circular Gauge) --- */
    .quality-score-card {
      background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      padding: 20px;
      margin-bottom: 16px;
      display: flex;
      align-items: center;
      gap: 24px;
    }
    
    .quality-gauge {
      position: relative;
      width: 100px;
      height: 100px;
      flex-shrink: 0;
    }
    
    .quality-gauge svg {
      transform: rotate(-90deg);
      width: 100px;
      height: 100px;
    }
    
    .quality-gauge-bg {
      fill: none;
      stroke: var(--bg-hover);
      stroke-width: 8;
    }
    
    .quality-gauge-fill {
      fill: none;
      stroke-width: 8;
      stroke-linecap: round;
      transition: stroke-dashoffset 0.6s ease, stroke 0.3s ease;
    }
    
    .quality-gauge-fill.score-excellent { stroke: var(--accent-success); }
    .quality-gauge-fill.score-good { stroke: #22c55e; }
    .quality-gauge-fill.score-fair { stroke: var(--accent-warning); }
    .quality-gauge-fill.score-poor { stroke: var(--accent-danger); }
    
    .quality-gauge-center {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      text-align: center;
    }
    
    .quality-gauge-value {
      font-size: 1.75rem;
      font-weight: 700;
      line-height: 1;
      color: var(--text-primary);
    }
    
    .quality-gauge-label {
      font-size: 0.625rem;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-top: 2px;
    }
    
    .quality-score-info {
      flex: 1;
    }
    
    .quality-score-title {
      font-size: 1rem;
      font-weight: 600;
      color: var(--text-primary);
      margin-bottom: 4px;
    }
    
    .quality-score-status {
      font-size: 0.8125rem;
      color: var(--text-secondary);
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    
    .quality-score-status .status-icon {
      font-size: 1rem;
    }
    
    .quality-score-hint {
      font-size: 0.75rem;
      color: var(--text-muted);
    }
    
    .score-excellent .quality-score-status { color: var(--accent-success); }
    .score-good .quality-score-status { color: #22c55e; }
    .score-fair .quality-score-status { color: var(--accent-warning); }
    .score-poor .quality-score-status { color: var(--accent-danger); }
    
    /* --- QUALITY METRICS GRID --- */
    .quality-metrics-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 8px;
      margin-bottom: 16px;
    }
    
    .quality-metric {
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 10px 12px;
      cursor: pointer;
      transition: all var(--transition-fast);
    }
    
    .quality-metric:hover {
      background: var(--bg-hover);
      border-color: var(--accent-primary);
    }
    
    .quality-metric-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }
    
    .quality-metric-label {
      font-size: 0.75rem;
      color: var(--text-secondary);
    }
    
    .quality-metric-value {
      font-size: 0.875rem;
      font-weight: 600;
    }
    
    .quality-metric-bar {
      height: 4px;
      background: var(--bg-tertiary);
      border-radius: 2px;
      overflow: hidden;
    }
    
    .quality-metric-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.3s ease;
    }
    
    .metric-excellent { background: var(--accent-success); }
    .metric-good { background: #22c55e; }
    .metric-fair { background: var(--accent-warning); }
    .metric-poor { background: var(--accent-danger); }
    
    /* --- DATA ISSUES SUMMARY --- */
    .data-issues-summary {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 12px 16px;
      margin: 16px 0;
    }
    
    .issues-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 10px;
    }
    
    .issues-title {
      font-size: 0.875rem;
      font-weight: 600;
    }
    
    .issues-count {
      font-size: 0.75rem;
      padding: 2px 8px;
      border-radius: var(--radius-full);
      background: var(--accent-danger-light);
      color: var(--accent-danger);
      font-weight: 600;
    }
    
    .issues-count.no-issues {
      background: var(--accent-success-light);
      color: var(--accent-success);
    }
    
    .issue-category {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 0;
      font-size: 0.8125rem;
      border-bottom: 1px solid var(--border-light);
      cursor: pointer;
    }
    
    .issue-category:last-child {
      border-bottom: none;
    }
    
    .issue-category:hover {
      color: var(--accent-primary);
    }
    
    .issue-category-count {
      font-weight: 600;
      padding: 2px 8px;
      border-radius: var(--radius-full);
      font-size: 0.6875rem;
    }
    
    .issue-category-count.has-issues {
      background: var(--accent-warning-light);
      color: #a16207;
    }
    
    .issue-category-count.critical {
      background: var(--accent-danger-light);
      color: var(--accent-danger);
    }
    
    .issue-category-count.clear {
      background: var(--accent-success-light);
      color: var(--accent-success);
    }
    
    /* --- CLASS COMPLETENESS --- */
    .class-completeness {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    
    .class-row {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.8125rem;
      cursor: pointer;
      padding: 4px 0;
    }
    
    .class-row:hover {
      color: var(--accent-primary);
    }
    
    .class-name {
      width: 140px;
      flex-shrink: 0;
    }
    
    .class-bar-container {
      flex: 1;
      height: 12px;
      background: var(--bg-tertiary);
      border-radius: var(--radius-sm);
      overflow: hidden;
    }
    
    .class-bar-fill {
      height: 100%;
      border-radius: var(--radius-sm);
      transition: width 0.3s ease;
    }
    
    .class-stats {
      width: 80px;
      text-align: right;
      font-size: 0.75rem;
      color: var(--text-secondary);
    }

    /* --- COLLAPSIBLE SECTION --- */
    .collapsible-section {
      margin-top: 16px;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      overflow: hidden;
    }
    
    .collapsible-header {
      width: 100%;
      padding: 10px 12px;
      background: var(--bg-tertiary);
      border: none;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--text-primary);
      text-align: left;
      transition: background var(--transition-fast);
    }
    
    .collapsible-header:hover {
      background: var(--bg-hover);
    }
    
    .collapsible-hint {
      font-size: 0.6875rem;
      font-weight: 400;
      color: var(--text-muted);
    }
    
    .collapsible-content {
      padding: 12px;
      border-top: 1px solid var(--border-color);
      background: var(--bg-primary);
    }
    
    .collapsible-content h4 {
      margin-top: 12px;
    }
    
    .collapsible-content h4:first-child {
      margin-top: 0;
    }
    
    .section-description {
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-bottom: 12px;
      padding: 8px;
      background: var(--bg-tertiary);
      border-radius: var(--radius-sm);
    }

    /* --- TOOL SECTIONS --- */
    .tool-section {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 12px;
      margin-bottom: 12px;
    }
    
    .tool-section h4 {
      margin: 0 0 4px 0;
      font-size: 0.875rem;
      color: var(--text-primary);
    }
    
    .tool-description {
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-bottom: 10px;
    }
    
    .tool-inputs {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    
    .tool-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .tool-label {
      font-size: 0.75rem;
      color: var(--text-secondary);
      width: 140px;
      flex-shrink: 0;
    }
    
    .tool-select {
      flex: 1;
    }
    
    .tool-checkbox {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 0.75rem;
      color: var(--text-secondary);
      cursor: pointer;
      margin-right: 12px;
    }
    
    .tool-checkbox input {
      cursor: pointer;
    }
    
    .tool-results {
      margin-top: 10px;
      padding: 10px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      font-size: 0.8rem;
      max-height: 200px;
      overflow-y: auto;
    }
    
    .tool-results-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 8px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border-color);
    }
    
    .tool-results-count {
      font-weight: 600;
      color: var(--text-primary);
    }
    
    .tool-result-item {
      padding: 6px 8px;
      margin-bottom: 4px;
      background: var(--bg-tertiary);
      border-radius: var(--radius-sm);
      cursor: pointer;
      transition: background var(--transition-fast);
    }
    
    .tool-result-item:hover {
      background: var(--bg-hover);
    }
    
    .tool-result-item code {
      background: var(--bg-primary);
      padding: 1px 4px;
      border-radius: 2px;
      font-size: 0.75rem;
    }
    
    .tool-result-group {
      margin-bottom: 12px;
    }
    
    .tool-result-group-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 6px 8px;
      background: var(--accent-primary-light);
      border-radius: var(--radius-sm);
      margin-bottom: 4px;
      font-weight: 500;
    }
    
    .tool-result-group-header button {
      font-size: 0.6875rem;
      padding: 2px 8px;
    }
    
    .merge-target {
      border: 2px solid var(--accent-primary);
    }
    
    .variation-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 4px 8px;
      margin-left: 12px;
      font-size: 0.75rem;
    }
    
    .variation-count {
      color: var(--text-muted);
    }

    /* --- PROGRESS BAR --- */
    .progress-bar {
      height: 8px;
      background: #e9ecef;
      border-radius: 4px;
      overflow: hidden;
      margin: 4px 0;
    }

    .progress-fill {
      height: 100%;
      transition: width 0.3s ease;
    }

    .progress-low { background: #d9534f; }
    .progress-mid { background: #f0ad4e; }
    .progress-high { background: #5cb85c; }

    /* --- FIELD COMPLETENESS --- */
    .field-stats {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px 16px;
      font-size: 0.8rem;
    }

    .field-stat-row {
      display: flex;
      justify-content: space-between;
      padding: 2px 0;
      border-bottom: 1px solid #f0f0f0;
    }

    /* --- TAG GENERATOR --- */
    .tag-gen-preview {
      font-family: monospace;
      font-size: 1rem;
      padding: 8px;
      background: #f5f5f5;
      border-radius: 4px;
      text-align: center;
      margin: 8px 0;
      letter-spacing: 1px;
    }

    /* --- TOAST --- */
    .toast {
      position: fixed;
      bottom: 28px;
      right: 28px;
      background: var(--bg-primary);
      color: var(--text-primary);
      padding: 16px 22px;
      border-radius: var(--radius-lg);
      z-index: 2000;
      box-shadow: var(--shadow-float);
      border-left: 4px solid var(--text-muted);
      animation: toastSlideIn 0.4s var(--transition-spring);
      font-size: 0.875rem;
      font-weight: 500;
      max-width: 380px;
      backdrop-filter: blur(8px);
    }

    .toast-success { 
      border-left-color: var(--accent-success);
      background: linear-gradient(135deg, var(--accent-success-light) 0%, rgba(255,255,255,0.9) 100%);
      color: #065f46;
    }
    .toast-warning { 
      border-left-color: var(--accent-warning);
      background: linear-gradient(135deg, var(--accent-warning-light) 0%, rgba(255,255,255,0.9) 100%);
      color: #92400e;
    }
    .toast-error { 
      border-left-color: var(--accent-danger);
      background: linear-gradient(135deg, var(--accent-danger-light) 0%, rgba(255,255,255,0.9) 100%);
      color: #991b1b;
    }

    [data-theme="dark"] .toast-success { color: #6ee7b7; background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, var(--bg-primary) 100%); }
    [data-theme="dark"] .toast-warning { color: #fcd34d; background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, var(--bg-primary) 100%); }
    [data-theme="dark"] .toast-error { color: #fca5a5; background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, var(--bg-primary) 100%); }

    @keyframes toastSlideIn {
      from { transform: translateX(120%); opacity: 0; }
      to { transform: translateX(0); opacity: 1; }
    }

    /* --- CONTROL DISABLED --- */
    .control-disabled {
      opacity: 0.5;
      pointer-events: none;
    }

    /* --- SMD SUGGESTION --- */
    .smd-suggestion {
      background: var(--accent-info-light);
      border: 1px solid #7dd3fc;
      border-radius: var(--radius-md);
      padding: 12px;
      margin-top: 12px;
      font-size: 0.8125rem;
    }

    .smd-suggestion strong {
      color: var(--accent-primary);
    }

    /* --- SMD PICKER --- */
    .smd-preview {
      margin-top: 12px;
      padding: 12px;
      background: var(--accent-primary-light);
      border-radius: var(--radius-md);
      border: 1px solid var(--accent-primary);
    }
    
    [data-theme="dark"] .smd-preview {
      background: rgba(37, 99, 235, 0.15);
    }
    
    .smd-preview-label {
      font-size: 0.6875rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--accent-primary);
      margin-bottom: 4px;
    }
    
    .smd-preview-text {
      font-family: var(--font-mono);
      font-size: 0.875rem;
      font-weight: 600;
      color: var(--text-primary);
    }
    
    .smd-iso-class {
      font-size: 0.75rem;
      color: var(--text-secondary);
      margin-top: 4px;
    }
    
    .smd-failure-modes {
      margin-top: 12px;
      padding: 12px;
      background: var(--bg-tertiary);
      border-radius: var(--radius-md);
      border: 1px solid var(--border-color);
    }
    
    .smd-failure-label {
      font-size: 0.6875rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--text-muted);
      margin-bottom: 8px;
    }
    
    .smd-failure-list {
      display: flex;
      flex-wrap: wrap;
      gap: 4px;
    }
    
    .smd-failure-tag {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-full);
      font-size: 0.6875rem;
      font-weight: 500;
      color: var(--text-secondary);
    }
    
    .smd-failure-tag code {
      font-family: var(--font-mono);
      font-weight: 600;
      color: var(--text-primary);
      margin-right: 4px;
    }

    /* --- SHORTEN PREVIEW PANEL --- */
    .shorten-preview-panel {
      margin-top: 12px;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      background: var(--bg-secondary);
      max-height: 400px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .shorten-preview-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 12px;
      background: var(--bg-tertiary);
      border-bottom: 1px solid var(--border-color);
      font-weight: 600;
      font-size: 0.85rem;
    }
    .shorten-preview-content {
      overflow-y: auto;
      padding: 8px;
      flex: 1;
    }
    .shorten-preview-item {
      display: grid;
      grid-template-columns: 1fr auto 1fr;
      gap: 8px;
      padding: 6px 8px;
      border-bottom: 1px solid var(--border-color);
      font-size: 0.8rem;
      align-items: center;
    }
    .shorten-preview-item:last-child { border-bottom: none; }
    .shorten-preview-item:hover { background: var(--bg-primary); }
    .shorten-original {
      color: var(--text-secondary);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .shorten-arrow {
      color: var(--accent-primary);
      font-weight: bold;
    }
    .shorten-result {
      font-family: var(--font-mono);
      font-weight: 600;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .shorten-result.too-long { color: var(--danger); }
    .shorten-result.ok { color: var(--success); }
    .shorten-char-count {
      font-size: 0.7rem;
      color: var(--text-tertiary);
      margin-left: 4px;
    }

    /* --- INLINE VALIDATION ICON --- */
    .validation-icon {
      margin-left: 6px;
      font-size: 0.9rem;
    }

    .validation-ok { color: var(--accent-success); }
    .validation-warn { color: var(--accent-warning); }
    .validation-error { color: var(--accent-danger); }

    /* --- FILTER BAR --- */
    .filter-bar {
      display: flex;
      gap: 16px;
      flex-wrap: wrap;
      align-items: center;
      font-size: 0.8125rem;
      padding: 10px 16px;
      background: var(--bg-tertiary);
      border-bottom: 1px solid var(--border-color);
    }
    .filter-bar label {
      display: flex;
      align-items: center;
      gap: 6px;
      cursor: pointer;
      color: var(--text-secondary);
      font-weight: 500;
      transition: color var(--transition-fast);
    }
    .filter-bar label:hover {
      color: var(--text-primary);
    }
    .filter-bar input[type="checkbox"],
    .filter-bar input[type="radio"] {
      accent-color: var(--accent-primary);
      width: 14px;
      height: 14px;
    }
    .filter-bar select {
      font-size: 0.8125rem;
      padding: 4px 8px;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      background: var(--bg-primary);
    }
    .filter-divider {
      width: 1px;
      height: 16px;
      background: var(--border-color);
    }

    /* --- TREE HEADER WITH CONTROLS --- */
    .tree-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 18px 10px 18px;
      background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 100%);
      border-bottom: 1px solid var(--border-light);
    }
    
    [data-theme="dark"] .tree-header {
      background: linear-gradient(180deg, rgba(30,41,59,0.5) 0%, transparent 100%);
    }
    
    .tree-header h2 { 
      margin: 0;
      font-size: 0.6875rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .tree-header h2::before {
      content: '';
      display: block;
      width: 3px;
      height: 14px;
      background: var(--accent-primary-gradient);
      border-radius: 2px;
    }
    
    .tree-controls {
      display: flex;
      gap: 2px;
      background: var(--bg-tertiary);
      padding: 3px;
      border-radius: var(--radius-md);
    }
    .tree-controls button {
      padding: 5px 10px;
      font-size: 0.6875rem;
      font-weight: 500;
      cursor: pointer;
      border: none;
      background: transparent;
      color: var(--text-muted);
      border-radius: var(--radius-sm);
      transition: all var(--transition-fast);
    }
    .tree-controls button:hover { 
      background: var(--bg-primary);
      color: var(--text-primary);
      box-shadow: var(--shadow-xs);
    }

    /* --- CHILD COUNT BADGE --- */
    .child-count {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-left: 6px;
      padding: 0 6px;
      min-width: 18px;
      height: 18px;
      border-radius: 9px;
      font-size: 0.625rem;
      font-weight: 600;
      background: var(--bg-tertiary);
      color: var(--text-muted);
    }
    .child-count.has-equipment {
      background: var(--accent-warning-light);
      color: #92400e;
    }

    /* --- NOTES INDICATOR --- */
    .notes-indicator {
      display: inline-flex;
      align-items: center;
      margin-left: 6px;
      font-size: 0.75rem;
      color: var(--accent-primary);
      cursor: help;
    }

    /* --- NOTES TEXTAREA --- */
    .notes-textarea {
      width: 100%;
      min-height: 80px;
      padding: 10px 12px;
      font-size: 0.85rem;
      border: 1px solid #ccc;
      border-radius: 4px;
      box-sizing: border-box;
      resize: vertical;
      font-family: inherit;
    }

    /* --- V4: EFFECTIVE CRITICALITY BOX --- */
    .effective-criticality-box {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-top: 12px;
      padding: 10px 12px;
      background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
      border: 1px solid #dee2e6;
      border-radius: 6px;
      font-size: 0.85rem;
    }
    .eff-crit-label {
      color: #495057;
      font-weight: 500;
    }
    .eff-crit-value {
      font-weight: 700;
      padding: 2px 10px;
      border-radius: 4px;
      min-width: 24px;
      text-align: center;
    }
    .eff-crit-value.crit-A { background: #ffcdd2; color: #b71c1c; }
    .eff-crit-value.crit-B { background: #ffe0b2; color: #e65100; }
    .eff-crit-value.crit-C { background: #c8e6c9; color: #2e7d32; }
    .eff-crit-value.crit-U { background: #e0e0e0; color: #616161; }
    .eff-crit-note {
      color: #6c757d;
      font-size: 0.8rem;
      font-style: italic;
    }

    /* --- V4: REDUNDANCY BADGE ON TREE --- */
    .redundancy-badge {
      display: inline-block;
      margin-left: 4px;
      padding: 1px 5px;
      font-size: 0.6rem;
      font-weight: 600;
      border-radius: 3px;
      text-transform: uppercase;
      vertical-align: middle;
    }
    .redundancy-badge.has-standby { background: #e3f2fd; color: #1565c0; }
    .redundancy-badge.is-standby { background: #f3e5f5; color: #7b1fa2; }
    .redundancy-badge.parallel { background: #fff3e0; color: #ef6c00; }

    /* --- V4: TEMPLATE LIST --- */
    .template-list {
      max-height: 200px;
      overflow: auto;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      margin-bottom: 12px;
    }
    .template-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 8px 12px;
      border-bottom: 1px solid var(--border-color);
      cursor: pointer;
    }
    .template-item:last-child { border-bottom: none; }
    .template-item:hover { background: var(--bg-hover); }
    .template-item.selected { background: var(--accent-primary-light); }
    .template-item .name { font-weight: 500; }
    .template-item .desc { font-size: 0.75rem; color: var(--text-muted); }
    .template-item .has-children { 
      font-size: 0.625rem; 
      background: var(--accent-primary); 
      color: white; 
      padding: 1px 6px; 
      border-radius: var(--radius-full);
      margin-left: 6px;
    }
    
    /* Template children section in save modal */
    .template-children-section {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border-color);
    }
    
    .template-children-header {
      margin-bottom: 8px;
    }
    
    .template-children-list {
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 10px;
      max-height: 180px;
      overflow-y: auto;
    }
    
    .template-child-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 8px;
      margin-bottom: 4px;
      background: var(--bg-primary);
      border-radius: var(--radius-sm);
      font-size: 0.8125rem;
    }
    
    .template-child-item:last-child {
      margin-bottom: 0;
    }
    
    .template-child-item input[type="checkbox"] {
      cursor: pointer;
    }
    
    .template-child-item .child-tag {
      font-weight: 500;
      color: var(--text-primary);
    }
    
    .template-child-item .child-name {
      color: var(--text-secondary);
      font-size: 0.75rem;
    }

    /* --- V4: KEYBOARD SHORTCUTS --- */
    .shortcuts-grid {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 4px 12px;
      font-size: 0.8rem;
    }
    .shortcuts-grid kbd {
      background: #f5f5f5;
      border: 1px solid #ddd;
      border-radius: 3px;
      padding: 2px 6px;
      font-family: monospace;
      font-size: 0.75rem;
    }

    /* --- V4: COPY FROM SECTION --- */
    .copy-from-section {
      background: #f9f9f9;
      border: 1px solid #e0e0e0;
      border-radius: 4px;
      padding: 8px;
      margin-bottom: 12px;
    }
    .copy-from-section select {
      width: 100%;
      margin-top: 4px;
    }

    /* --- V4: ROW ADD BUTTON --- */
    .row-add-btn {
      display: none;
      margin-left: auto;
      padding: 0 6px;
      font-size: 0.9rem;
      font-weight: bold;
      color: #1976d2;
      cursor: pointer;
      border-radius: 3px;
    }
    .row-add-btn:hover {
      background: #e3f2fd;
    }
    .tree-row:hover .row-add-btn,
    .tree-row.selected .row-add-btn {
      display: inline-block;
    }
    
    /* Accessibility: Skip link */
    .skip-link:focus {
      position: fixed !important;
      left: 10px !important;
      top: 10px !important;
      width: auto !important;
      height: auto !important;
      padding: 8px 16px;
      background: #0066cc;
      color: white;
      text-decoration: none;
      border-radius: 4px;
      z-index: 10000;
    }
    
    /* Accessibility: Focus visibility */
    *:focus-visible {
      outline: 2px solid var(--accent-primary);
      outline-offset: 2px;
    }
    
    button:focus-visible,
    input:focus-visible,
    select:focus-visible,
    textarea:focus-visible {
      outline: 2px solid var(--accent-primary);
      outline-offset: 1px;
    }

    /* Theme toggle button */
    .theme-toggle {
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--bg-tertiary);
      border: none;
      border-radius: var(--radius-md);
      cursor: pointer;
      color: var(--text-muted);
      transition: all var(--transition-fast);
    }
    .theme-toggle:hover {
      background: var(--bg-hover);
      color: var(--text-primary);
    }
    .theme-toggle svg {
      width: 18px;
      height: 18px;
    }

    /* Screen reader only */
    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    
    /* Loading indicator */
    .loading-overlay {
      position: fixed;
      inset: 0;
      background: rgba(255, 255, 255, 0.8);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
    }
    
    .loading-spinner {
      width: 40px;
      height: 40px;
      border: 4px solid #e0e0e0;
      border-top-color: #0066cc;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
    
    @keyframes spin {
      to { transform: rotate(360deg); }
    }
    
    .loading-text {
      margin-left: 12px;
      font-size: 0.9rem;
      color: #666;
    }
    
    /* --- ISO 14224 DATA ENTRY ASSISTANT --- */
    /* CMMS Equipment Code Dropdown */
    .cmms-code-display {
      font-family: var(--font-mono);
      font-weight: 700;
      font-size: 1.1rem;
      color: var(--accent-primary);
      background: var(--bg-secondary);
      padding: 8px 12px;
      border-radius: 6px;
      min-width: 60px;
      text-align: center;
      border: 2px solid var(--border-color);
    }
    .cmms-code-display.has-code {
      background: var(--accent-primary);
      color: white;
      border-color: var(--accent-primary);
    }
    .btn-icon {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: 4px;
      padding: 4px 8px;
      cursor: pointer;
      font-size: 0.9rem;
      color: var(--text-secondary);
    }
    .btn-icon:hover {
      background: var(--danger);
      color: white;
      border-color: var(--danger);
    }
    .cmms-code-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      max-height: 250px;
      overflow-y: auto;
      background: var(--bg-primary);
      border: 1px solid var(--border-color);
      border-top: none;
      border-radius: 0 0 8px 8px;
      box-shadow: 0 4px 12px rgba(0,0,0,0.15);
      z-index: 1000;
    }
    .cmms-code-item {
      padding: 8px 12px;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid var(--border-color);
    }
    .cmms-code-item:last-child { border-bottom: none; }
    .cmms-code-item:hover { background: var(--bg-secondary); }
    .cmms-code-item.selected { background: var(--accent-primary); color: white; }
    .cmms-code-item-code {
      font-family: var(--font-mono);
      font-weight: 600;
      color: var(--accent-primary);
      min-width: 50px;
    }
    .cmms-code-item:hover .cmms-code-item-code,
    .cmms-code-item.selected .cmms-code-item-code { color: inherit; }
    .cmms-code-item-name { flex: 1; margin-left: 12px; font-size: 0.9rem; }
    .cmms-code-item-iso {
      font-size: 0.75rem;
      background: var(--bg-secondary);
      padding: 2px 6px;
      border-radius: 4px;
      margin-left: 8px;
    }
    .cmms-code-desc {
      margin-top: 4px;
      padding: 8px 12px;
      background: var(--bg-secondary);
      border-radius: 6px;
      font-size: 0.85rem;
    }
    .cmms-code-desc .code { font-family: var(--font-mono); font-weight: 600; color: var(--accent-primary); }
    .cmms-code-desc .iso { color: var(--text-tertiary); font-size: 0.8rem; margin-left: 8px; }

    .custom-code-panel {
      margin-top: 8px;
      padding: 12px;
      background: linear-gradient(135deg, #fff8e6 0%, #fff3d6 100%);
      border: 1px solid #f0c36d;
      border-radius: 8px;
    }
    .custom-code-info {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 0.9rem;
      color: #856404;
    }
    .custom-code-badge {
      background: #ffc107;
      color: #856404;
      padding: 2px 8px;
      border-radius: 4px;
      font-size: 0.75rem;
      font-weight: 700;
    }
    .btn-success {
      background: var(--success);
      color: white;
      border: none;
      padding: 8px 16px;
      border-radius: 6px;
      cursor: pointer;
      font-weight: 500;
    }
    .btn-success:hover {
      background: #218838;
    }
    .custom-code-saved {
      background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
      border-color: #81c784;
    }
    .custom-code-saved .custom-code-badge {
      background: var(--success);
      color: white;
    }
    .custom-code-saved .custom-code-info {
      color: #2e7d32;
    }
    
    .duplicate-hint {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: #fff3cd;
      border: 1px solid #ffc107;
      border-radius: 6px;
      font-size: 0.85rem;
      color: #856404;
    }
    .duplicate-hint.exact {
      background: #f8d7da;
      border-color: #f5c6cb;
      color: #721c24;
    }
    .duplicate-hint-icon {
      font-size: 1rem;
    }
    .duplicate-hint-text {
      flex: 1;
    }
    .duplicate-hint-code {
      font-family: var(--font-mono);
      font-weight: 600;
      background: rgba(0,0,0,0.1);
      padding: 2px 6px;
      border-radius: 4px;
    }

    .iso-assistant-panel {
      background: var(--bg-secondary);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-lg);
      margin-top: 16px;
      overflow: hidden;
    }
    
    .iso-assistant-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
      color: white;
      cursor: pointer;
      user-select: none;
    }
    
    .iso-assistant-header:hover {
      background: linear-gradient(135deg, #0052a3 0%, #003d7a 100%);
    }
    
    .iso-assistant-header h4 {
      margin: 0;
      font-size: 0.875rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .iso-assistant-header .badge {
      background: rgba(255,255,255,0.2);
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 0.75rem;
      font-weight: 500;
    }
    
    .iso-assistant-body {
      padding: 16px;
      display: none;
    }
    
    .iso-assistant-body.expanded {
      display: block;
    }
    
    .iso-field-group {
      margin-bottom: 16px;
    }
    
    .iso-field-group-title {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      margin-bottom: 8px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    
    .iso-fields-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
    }
    
    .iso-field {
      position: relative;
    }
    
    .iso-field label {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 0.8125rem;
      font-weight: 500;
      color: var(--text-secondary);
      margin-bottom: 4px;
    }
    
    .iso-field .priority-badge {
      font-size: 0.625rem;
      padding: 1px 5px;
      border-radius: 8px;
      font-weight: 600;
      text-transform: uppercase;
    }
    
    .priority-H {
      background: #fee2e2;
      color: #b91c1c;
    }
    
    .priority-M {
      background: #fef3c7;
      color: #92400e;
    }
    
    .priority-L {
      background: #e0f2fe;
      color: #0369a1;
    }
    
    [data-theme="dark"] .priority-H {
      background: #450a0a;
      color: #fca5a5;
    }
    
    [data-theme="dark"] .priority-M {
      background: #451a03;
      color: #fcd34d;
    }
    
    [data-theme="dark"] .priority-L {
      background: #082f49;
      color: #7dd3fc;
    }
    
    .iso-field input,
    .iso-field select {
      width: 100%;
      padding: 8px 10px;
      font-size: 0.8125rem;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      background: var(--bg-primary);
      color: var(--text-primary);
    }
    
    .iso-field input:focus,
    .iso-field select:focus {
      outline: none;
      border-color: var(--accent-primary);
      box-shadow: 0 0 0 3px var(--accent-primary-light);
    }
    
    .iso-field .unit-label {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(25%);
      font-size: 0.75rem;
      color: var(--text-muted);
      pointer-events: none;
    }
    
    .iso-failure-modes {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 8px;
    }
    
    .iso-failure-mode-chip {
      padding: 4px 10px;
      font-size: 0.75rem;
      background: var(--bg-tertiary);
      border: 1px solid var(--border-color);
      border-radius: 12px;
      cursor: pointer;
      transition: all var(--transition-fast);
    }
    
    .iso-failure-mode-chip:hover {
      background: var(--accent-primary-light);
      border-color: var(--accent-primary);
    }
    
    .iso-failure-mode-chip.selected {
      background: var(--accent-primary);
      color: white;
      border-color: var(--accent-primary);
    }
    
    .iso-info-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px 8px;
      background: #dbeafe;
      color: #1e40af;
      border-radius: var(--radius-md);
      font-size: 0.75rem;
      font-weight: 500;
    }
    
    [data-theme="dark"] .iso-info-badge {
      background: #1e3a5f;
      color: #93c5fd;
    }
    
    .iso-toggle-btn {
      width: 24px;
      height: 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      background: rgba(255,255,255,0.1);
      border: none;
      border-radius: 4px;
      color: white;
      cursor: pointer;
      transition: background var(--transition-fast);
    }
    
    .iso-toggle-btn:hover {
      background: rgba(255,255,255,0.2);
    }
/* ============================================================
   AUTHENTICATION & DASHBOARD STYLES
   ============================================================ */

/* Screen management */
.screen { display: none; }
.screen.active { display: block; }
#appScreen.active { display: flex; flex-direction: column; height: 100vh; }

/* Auth container */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    radial-gradient(ellipse at 20% 80%, rgba(201, 81, 47, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(30, 58, 95, 0.2) 0%, transparent 50%),
    linear-gradient(160deg, #0f172a 0%, #1e293b 40%, #1a1f2e 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Animated gradient orbs */
.auth-container::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 81, 47, 0.08) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 20s ease-in-out infinite;
}

.auth-container::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.06) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -30px) scale(1.05); }
}

.auth-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 32px 64px -16px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  padding: 48px 44px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 36px;
}

.auth-logo svg,
.auth-logo img {
  width: 56px;
  height: 56px;
  color: var(--accent-primary);
  filter: drop-shadow(0 4px 12px rgba(201, 81, 47, 0.3));
}

.auth-logo h1 {
  margin: 16px 0 6px 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 400;
  font-style: italic;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.auth-logo p {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 400;
}

.auth-logo .auth-tagline {
  color: #c9512f;
  font-size: 13px;
  font-weight: 500;
  font-style: italic;
  margin-bottom: 8px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.auth-form label {
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  letter-spacing: 0.01em;
}

.auth-form input {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-sans);
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
  transition: all var(--transition-fast);
}

.auth-form input::placeholder {
  color: #64748b;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(201, 81, 47, 0.15);
}

.auth-form .btn-primary {
  margin-top: 12px;
  padding: 16px;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  letter-spacing: 0.01em;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0;
  color: #64748b;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

.auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 14px;
  color: #94a3b8;
}

.auth-footer a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.auth-footer a:hover {
  color: #e8734f;
  text-decoration: none;
}

.auth-link-btn {
  background: none;
  border: none;
  color: var(--accent-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 16px;
  transition: color var(--transition-fast);
}

.auth-link-btn:hover {
  color: #e8734f;
}

.auth-error {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #fca5a5;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  display: none;
}

.auth-error.show {
  display: block;
}

/* Dashboard container */
.dashboard-container {
  min-height: 100vh;
  background: var(--bg-secondary);
}

/* ========== NEW POLISHED DASHBOARD LAYOUT ========== */

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  background: #f8f9fc;
}

/* Sidebar */
.dashboard-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1a1f2e 0%, #0f1219 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-logo img {
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(201, 81, 47, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 12px;
  overflow-y: auto;
}

.nav-section {
  margin-bottom: 24px;
}

.nav-section-title {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
  padding: 0 12px;
  margin-bottom: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

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

.nav-item.active {
  background: rgba(201, 81, 47, 0.2);
  color: #fff;
}

.nav-item.active svg {
  color: var(--accent-primary);
}

/* Sidebar org selector */
.sidebar-org-selector {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-org-selector .org-row {
  background: rgba(255,255,255,0.05);
  border: none;
  border-radius: 8px;
  padding: 0;
  margin-bottom: 4px;
}

.sidebar-org-selector .org-row:hover {
  background: rgba(255,255,255,0.1);
}

.sidebar-org-selector .org-row.selected {
  background: rgba(201, 81, 47, 0.2);
  border-left: none;
}

.sidebar-org-selector .org-row-main {
  padding: 10px 12px;
}

.sidebar-org-selector .org-icon {
  width: 32px;
  height: 32px;
  font-size: 14px;
  border-radius: 8px;
  margin-right: 10px;
}

.sidebar-org-selector .org-name {
  color: #ffffff;
  font-size: 13px;
}

.sidebar-org-selector .org-stats {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
}

.sidebar-org-selector .add-org-row {
  border-top: 1px dashed rgba(255,255,255,0.1);
  margin-top: 8px;
  padding-top: 8px;
}

.sidebar-org-selector .add-org-row .org-icon {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
}

.sidebar-org-selector .add-org-row .org-name {
  color: var(--accent-primary);
}

.sidebar-org-selector .org-delete-btn {
  color: rgba(255,255,255,0.4);
}

.sidebar-org-selector .org-delete-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-primary), #e06844);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
}

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

.user-name-text {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-org-text {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-badge-small {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.sidebar-signout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.sidebar-signout:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.25);
  color: #ffffff;
}

/* Main content area */
.dashboard-main {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.dashboard-topbar {
  background: #ffffff;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title h1 {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0;
}

.topbar-title p {
  font-size: 13px;
  color: #6b7280;
  margin: 4px 0 0 0;
}

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

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

.search-wrapper svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.search-wrapper input {
  width: 100%;
  padding: 10px 12px 10px 40px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  background: #f9fafb;
  transition: all 0.2s;
}

.search-wrapper input:focus {
  outline: none;
  border-color: var(--accent-primary);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(201, 81, 47, 0.1);
}

.search-wrapper input::placeholder {
  color: #9ca3af;
}

/* Dashboard content */
.dashboard-content {
  padding: 32px;
  flex: 1;
}

/* Dashboard panels grid */
.dashboard-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
}

.panel {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #f3f4f6;
}

.panel-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.panel-content {
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f3f4f6;
  border-radius: 8px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: #e5e7eb;
  color: #111827;
}

.btn-icon-text {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  background: var(--accent-primary);
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

/* Project cards */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-primary), #e06844);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.project-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 10px 40px -10px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.project-card:hover::before {
  transform: scaleX(1);
}

.project-card.new-project {
  border: 2px dashed #d1d5db;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: #9ca3af;
  background: #fafafa;
  box-shadow: none;
}

.project-card.new-project::before {
  display: none;
}

.project-card.new-project:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: #fef7f5;
  transform: none;
  box-shadow: none;
}

.project-card.new-project svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
  transition: all 0.2s;
}

.project-card.new-project:hover svg {
  opacity: 1;
  transform: scale(1.1);
}

.project-card.new-project span {
  font-size: 14px;
  font-weight: 500;
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 20px 0 20px;
}

.project-card-title {
  font-weight: 600;
  font-size: 16px;
  color: #111827;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-status-select {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.project-status-select.draft { background: #e0e7ff; color: #4338ca; }
.project-status-select.in_review { background: #fef3c7; color: #d97706; }
.project-status-select.complete { background: #d1fae5; color: #059669; }
.project-status-select.archived { background: #f3f4f6; color: #6b7280; }

.project-delete-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: #9ca3af;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.project-delete-btn:hover {
  background: #fef2f2;
  color: #dc2626;
}

.project-card-body {
  padding: 16px 20px 20px 20px;
}

.project-card-desc {
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #9ca3af;
  padding-top: 16px;
  border-top: 1px solid #f3f4f6;
}

.project-card-meta span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.project-card-meta svg {
  opacity: 0.7;
}

/* Team section */
.team-section {
  margin-top: 0;
}

.team-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0;
}

.team-list {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.team-panel .team-list {
  padding: 0;
}

.team-row {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}

.team-row:last-child {
  border-bottom: none;
}

.team-row:hover {
  background: #f9fafb;
}
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.team-row:last-child {
  border-bottom: none;
}

.team-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  margin-right: 12px;
  flex-shrink: 0;
}

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

.team-name {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
}

.team-email {
  font-size: 12px;
  color: #6b7280;
}

.team-role {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  background: #f3f4f6;
  color: #6b7280;
}

.team-role.admin { background: #dbeafe; color: #1d4ed8; }
.team-role.editor { background: #e0e7ff; color: #4338ca; }
.team-role.viewer { background: #f3f4f6; color: #6b7280; }

.team-role-select {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.15s;
}

.team-role-select.admin { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.team-role-select.editor { background: #e0e7ff; color: #4338ca; border-color: #c7d2fe; }
.team-role-select.viewer { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }

.team-role-select:hover {
  border-color: var(--accent-primary);
}

.btn-danger {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #9ca3af;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* Admin dashboard */
.admin-badge {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.org-selector {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 24px;
  overflow: hidden;
}

.org-row {
  display: flex;
  align-items: center;
  padding: 0;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

.org-row-main {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  flex: 1;
  cursor: pointer;
}

.org-row:hover {
  background: var(--bg-secondary);
}

.org-row:last-child {
  border-bottom: none;
}

.org-row.selected {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--accent-primary);
}

.org-delete-btn {
  padding: 8px 12px;
  margin-right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
  opacity: 0;
}

.org-row:hover .org-delete-btn {
  opacity: 1;
}

.org-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.add-org-row {
  border-top: 1px dashed var(--border-color);
  margin-top: 8px;
}

.add-org-row:hover {
  background: rgba(59, 130, 246, 0.05);
}

.org-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  margin-right: 16px;
}

.org-info {
  flex: 1;
}

.org-name {
  font-weight: 600;
  color: var(--text-primary);
}

.org-stats {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Loading spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-card {
  background: var(--panel-bg);
  padding: 32px 48px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.loading-card .spinner {
  width: 32px;
  height: 32px;
}

/* ============================================================
   SAVE STATUS INDICATOR
   ============================================================ */

.save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  margin-right: 8px;
}

.save-status.saving {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.save-status.saved {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.save-status.error {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

.save-status.offline {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.save-status.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.save-status-icon {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.save-status.saving .save-status-icon::after {
  content: '';
  width: 12px;
  height: 12px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.save-status.saved .save-status-icon::after {
  content: '✓';
  font-size: 14px;
}

.save-status.error .save-status-icon::after {
  content: '✗';
  font-size: 14px;
}

.save-status.offline .save-status-icon::after {
  content: '○';
  font-size: 14px;
}

/* ============================================================
   PROJECT CARD IMPROVEMENTS
   ============================================================ */

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

.project-card-title {
  cursor: pointer;
  flex: 1;
}

.project-card-title:hover {
  color: var(--accent-primary);
}

.project-card-body {
  cursor: pointer;
}

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

.project-status-select {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  padding-right: 24px;
}

.project-status-select:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.project-status-select.draft { background-color: #e0e7ff; color: #4338ca; }
.project-status-select.in_review { background-color: #fef3c7; color: #d97706; }
.project-status-select.complete { background-color: #d1fae5; color: #059669; }
.project-status-select.archived { background-color: #f3f4f6; color: #6b7280; }

.project-delete-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.project-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ============================================================
   DASHBOARD IMPROVEMENTS
   ============================================================ */

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

.project-search {
  padding: 10px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text-primary);
  min-width: 250px;
}

.project-search:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Activity Section */
.activity-section {
  margin-top: 48px;
}

.activity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.activity-list {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
}

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

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.project { background: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.activity-icon.member { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.activity-icon.status { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
}

.activity-text strong {
  font-weight: 600;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.activity-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

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

/* ============================================================
   ASSET COMMENTS
   ============================================================ */

.asset-comments-section {
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
  user-select: none;
}

.comments-header h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.comments-header .badge {
  background: var(--accent-primary);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.comments-toggle-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.comments-toggle-btn:hover {
  background: var(--bg-hover);
}

.comments-content {
  padding-bottom: 16px;
}

.comments-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.comment-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-hover);
  border-radius: 8px;
  margin-bottom: 8px;
}

.comment-item.resolved {
  opacity: 0.6;
}

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.comment-body {
  flex: 1;
  min-width: 0;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comment-author {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

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

.comment-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-actions button {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  background: var(--panel-bg);
  color: var(--text-muted);
}

.comment-actions button:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.comment-input-area {
  display: flex;
  gap: 8px;
}

.comment-input-area textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  resize: none;
  background: var(--input-bg);
  color: var(--text-primary);
}

.comment-input-area textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ============================================================
   VERSION HISTORY
   ============================================================ */

.version-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.version-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.version-info {
  flex: 1;
}

.version-number {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.version-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.version-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

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

.version-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* Equipment Library Styles */
.library-match, .library-new {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.library-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--accent-primary-light);
  color: var(--accent-primary);
}

.library-badge.new {
  background: #fef3c7;
  color: #92400e;
}

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

.library-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  width: 100%;
}

.library-specs .spec-item {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  color: var(--text-secondary);
}

.library-specs .spec-tag {
  font-size: 0.75rem;
  padding: 2px 6px;
  background: #dcfce7;
  color: #166534;
  border-radius: 3px;
}

.library-new .btn-small {
  font-size: 0.75rem;
  padding: 4px 8px;
  margin-left: auto;
}

/* ============================================================
   TABBED MODAL REDESIGN - Progressive Disclosure
   ============================================================ */

/* Modal Tab Navigation */
.modal-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.modal-tab {
  padding: 12px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.modal-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  font-weight: 600;
}

.modal-tab .tab-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.modal-tab .tab-check.complete {
  background: var(--accent-success);
  color: white;
}

.modal-tab .tab-check.partial {
  background: var(--accent-warning);
  color: white;
}

/* Tab status indicators */
.tab-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 4px;
}

.tab-indicator.complete {
  background: var(--accent-success);
}

.tab-indicator.partial {
  background: var(--accent-warning);
}

.tab-indicator.empty {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
}

.tab-indicator.required {
  background: var(--accent-danger);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Modal Tab Content */
.modal-tab-content {
  display: none;
  padding: 24px;
  animation: fadeIn 0.15s ease-out;
}

.modal-tab-content.active {
  display: block;
}

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

/* Tabbed Modal Layout */
.modal.modal-tabbed {
  width: 680px;
  max-width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-tabbed .modal-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.modal-tabbed .modal-tab-content {
  overflow-y: auto;
  flex: 1;
}

/* Progress Indicator */
.modal-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.progress-bar-container {
  flex: 1;
  height: 6px;
  background: var(--bg-hover);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent-primary-gradient);
  border-radius: 3px;
  transition: width 0.3s ease-out;
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 80px;
  text-align: right;
}

.progress-text.excellent { color: var(--accent-success); }
.progress-text.good { color: var(--accent-primary); }
.progress-text.partial { color: var(--accent-warning); }

/* Field Groups in Tabs */
.field-group {
  margin-bottom: 20px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-group-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.field-row.single {
  grid-template-columns: 1fr;
}

.field-row:last-child {
  margin-bottom: 0;
}

/* Compact Field Labels */
.field-compact {
  margin-bottom: 16px;
}

.field-compact .field-label {
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.field-compact .field-input {
  padding: 8px 12px;
}

/* Required Field Indicator */
.required-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent-danger);
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

/* Quick Actions in Modal */
.modal-quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.quick-action-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-action-btn:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

/* Missing Fields Alert */
.missing-fields-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--accent-warning-light);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.missing-fields-alert .alert-icon {
  font-size: 1.1rem;
}

.missing-fields-alert .alert-content {
  flex: 1;
}

.missing-fields-alert .missing-list {
  margin-top: 4px;
  color: var(--text-secondary);
}

/* Inline Help Tooltips */
.field-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 0.7rem;
  margin-left: 6px;
  cursor: help;
  position: relative;
}

.field-help:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

/* Responsive: Stack on mobile */
@media (max-width: 700px) {
  .modal.modal-tabbed {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .modal-tabs {
    justify-content: flex-start;
    padding: 0 8px;
  }
  
  .modal-tab {
    padding: 10px 14px;
    font-size: 0.8rem;
  }
  
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* Dark mode for tabbed modal */
[data-theme="dark"] .modal-tabs {
  background: var(--bg-secondary);
}

[data-theme="dark"] .modal-tab:hover {
  background: var(--bg-hover);
}

[data-theme="dark"] .modal-progress {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .progress-bar {
  background: var(--bg-hover);
}

[data-theme="dark"] .tab-indicator.empty {
  background: var(--bg-hover);
  color: var(--text-muted);
}

[data-theme="dark"] .field-group-title::after {
  background: var(--border-color);
}

[data-theme="dark"] .missing-fields-alert {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-warning);
}

[data-theme="dark"] .crit-selector-btn {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="dark"] .crit-selector-btn:hover {
  background: var(--bg-hover);
}

[data-theme="dark"] .similar-assets-panel {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--accent-info);
}

/* Criticality visual selector */
.crit-selector {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.crit-selector-btn {
  flex: 1;
  padding: 10px 8px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.crit-selector-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.crit-selector-btn.active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.crit-selector-btn .crit-letter {
  font-size: 1.25rem;
  font-weight: 700;
  display: block;
  line-height: 1.2;
}

.crit-selector-btn .crit-label {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.crit-selector-btn.crit-a .crit-letter { color: var(--accent-danger); }
.crit-selector-btn.crit-b .crit-letter { color: var(--accent-warning); }
.crit-selector-btn.crit-c .crit-letter { color: var(--accent-success); }
.crit-selector-btn.crit-u .crit-letter { color: var(--text-muted); }

.crit-selector-btn.crit-a.active {
  border-color: var(--accent-danger);
  background: var(--accent-danger-light);
}

.crit-selector-btn.crit-b.active {
  border-color: var(--accent-warning);
  background: var(--accent-warning-light);
}

.crit-selector-btn.crit-c.active {
  border-color: var(--accent-success);
  background: var(--accent-success-light);
}

.crit-selector-btn.crit-u.active {
  border-color: var(--text-muted);
  background: var(--bg-tertiary);
}

/* Tab content field grid */
.tab-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.tab-field-grid.single-col {
  grid-template-columns: 1fr;
}

.tab-field-full {
  grid-column: 1 / -1;
}

@media (max-width: 600px) {
  .tab-field-grid {
    grid-template-columns: 1fr;
  }
}

/* Field group in tabs */
.tab-field-group {
  margin-bottom: 20px;
}

.tab-field-group:last-child {
  margin-bottom: 0;
}

.tab-field-group-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-field-group-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

/* Modal tabbed - single column layout */
.modal.modal-tabbed {
  width: 640px;
  max-width: 95vw;
  max-height: 90vh;
}

.modal.modal-tabbed .modal-body {
  padding: 0;
  display: block;
}

.modal-tabbed .modal-tab-wrapper {
  overflow-y: auto;
  max-height: calc(90vh - 180px);
}

/* Progress bar in modal */
.modal-completion-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.8rem;
}

.modal-completion-bar .bar-track {
  flex: 1;
  height: 5px;
  background: var(--border-color);
  border-radius: 3px;
  overflow: hidden;
}

.modal-completion-bar .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #e86b4a);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.modal-completion-bar .bar-percent {
  font-weight: 600;
  min-width: 42px;
  text-align: right;
}

.modal-completion-bar .bar-percent.excellent { color: var(--accent-success); }
.modal-completion-bar .bar-percent.good { color: var(--accent-primary); }
.modal-completion-bar .bar-percent.partial { color: var(--accent-warning); }
.modal-completion-bar .bar-percent.poor { color: var(--accent-danger); }

/* Missing fields alert in tab */
.tab-missing-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--accent-warning-light);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border-left: 3px solid var(--accent-warning);
  font-size: 0.8rem;
}

[data-theme="dark"] .tab-missing-alert {
  background: rgba(245, 158, 11, 0.12);
}

.tab-missing-alert-icon {
  font-size: 1rem;
  line-height: 1;
}

.tab-missing-alert-title {
  font-weight: 600;
  color: #92400e;
  margin-bottom: 2px;
}

[data-theme="dark"] .tab-missing-alert-title {
  color: #fbbf24;
}

.tab-missing-alert-list {
  color: var(--text-secondary);
}

/* Tab nav scroll hint */
.modal-tabs-wrapper {
  position: relative;
}

.modal-tabs-wrapper::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 30px;
  background: linear-gradient(90deg, transparent, var(--bg-primary));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.modal-tabs-wrapper.has-scroll::after {
  opacity: 1;
}


/* ============================================
   CONTEXT MENU (Right-click menu)
   ============================================ */
.context-menu {
  position: absolute;
  z-index: 10000;
  min-width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 6px 0;
  font-size: 0.85rem;
  animation: contextMenuFadeIn 0.15s ease-out;
}

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

.context-menu-item {
  padding: 8px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  transition: background 0.1s ease;
}

.context-menu-item:hover {
  background: var(--bg-tertiary);
}

.context-menu-item.context-menu-danger {
  color: var(--accent-danger);
}

.context-menu-item.context-menu-danger:hover {
  background: rgba(220, 38, 38, 0.1);
}

.context-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 6px 0;
}

[data-theme="dark"] .context-menu {
  background: var(--bg-secondary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}



/* Button link style for inline actions */
.btn-link {
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 0.85rem;
  text-decoration: underline;
}
.btn-link:hover {
  color: var(--accent-primary-hover, #0056b3);
}
.field-warning .btn-link {
  color: var(--accent-primary);
}

/* ============================================================
   DEMO MODE STYLES
   ============================================================ */

.demo-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

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

.demo-banner-content svg {
  flex-shrink: 0;
}

.demo-banner a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
}

.demo-banner a:hover {
  opacity: 0.9;
}

.demo-exit-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
}

.demo-exit-btn:hover {
  background: rgba(255,255,255,0.3);
}

body.demo-mode {
  padding-top: 44px;
}

body.demo-mode .screen.active {
  height: calc(100vh - 44px);
}

.demo-signup-note {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.demo-signup-note p {
  margin: 0;
}

.demo-signup-note strong {
  color: #78350f;
}

.try-demo-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color, #334155);
  text-align: center;
}

.try-demo-section p {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.try-demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: transparent;
  border: 2px solid var(--accent-primary, #c9512f);
  color: var(--accent-primary, #c9512f);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  max-width: 280px;
}

.try-demo-btn:hover {
  background: var(--accent-primary, #c9512f);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201, 81, 47, 0.3);
}

.try-demo-btn:active {
  transform: translateY(0);
}

.try-demo-btn svg {
  width: 18px;
  height: 18px;
}

.try-demo-text {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  margin-top: 10px;
}

[data-theme="dark"] .demo-signup-note {
  background: #78350f;
  border-color: #92400e;
  color: #fef3c7;
}

[data-theme="dark"] .demo-signup-note strong {
  color: #fde68a;
}

/* ============================================================
   QUICK CRITICALITY CALCULATOR
   ============================================================ */

.quick-crit-question {
  margin-bottom: 12px;
}

.quick-crit-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 6px;
  font-weight: 500;
}

.quick-crit-buttons {
  display: flex;
  gap: 6px;
}

.quick-crit-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-crit-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-muted);
}

.quick-crit-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  font-weight: 500;
}

.quick-crit-btn.quick-crit-danger.active {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
}

.quick-crit-result {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.quick-crit-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.quick-crit-result-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.quick-crit-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.quick-crit-sece-warning {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.8rem;
  color: #d97706;
}

.quick-crit-sece-warning svg {
  flex-shrink: 0;
  stroke: #d97706;
}

.quick-crit-sece-warning .btn {
  margin-left: auto;
  flex-shrink: 0;
}

.quick-crit-redundancy {
  padding: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.quick-crit-redundancy-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.quick-crit-redundancy-info svg {
  stroke: #3b82f6;
}

.quick-crit-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.quick-crit-checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

.quick-crit-children {
  padding: 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.quick-crit-children-note {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-left: 20px;
}

.quick-crit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 10px;
}

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

/* Quick Criticality Hints */
.quick-crit-hint {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.quick-crit-hint span {
  flex: 1;
  text-align: center;
}

.quick-crit-hint .hint-no {
  text-align: left;
  color: var(--accent-success, #22c55e);
}

.quick-crit-hint .hint-mid {
  color: var(--text-muted);
}

.quick-crit-hint .hint-yes {
  text-align: right;
  color: var(--accent-danger, #ef4444);
}

/* Demo Upgrade Modal */
.demo-upgrade-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.2s ease;
}

.demo-upgrade-content {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.demo-upgrade-content h3 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  color: var(--text-primary);
}

.demo-upgrade-content p {
  margin: 0 0 12px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.demo-upgrade-content ul {
  margin: 0 0 16px 0;
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.demo-upgrade-content li {
  margin-bottom: 6px;
}

.demo-upgrade-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* Risk Tab Two-Column Layout */
.risk-tab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.risk-col {
  min-width: 0;
}

.risk-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.compact-field {
  margin-bottom: 10px;
}

.compact-field .field-label {
  font-size: 0.75rem;
  margin-bottom: 3px;
}

.compact-field .field-input {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.field-row-2col.compact {
  gap: 8px;
}

.field-row-2col.compact .field-label {
  font-size: 0.75rem;
  margin-bottom: 3px;
}

.field-row-2col.compact .field-input {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.crit-calc-grid.compact .crit-calc-row {
  margin-bottom: 6px;
}

.crit-calc-grid.compact label {
  font-size: 0.75rem;
}

.crit-calc-grid.compact .crit-calc-select {
  padding: 4px 6px;
  font-size: 0.75rem;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 600px) {
  .risk-tab-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Details Tab Two-Column Layout */
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.details-col {
  min-width: 0;
}

.details-col h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.details-collapsible summary {
  list-style: none;
}

.details-collapsible summary::-webkit-details-marker {
  display: none;
}

.details-collapsible[open] summary {
  color: var(--text-primary);
}

/* Responsive: Stack on smaller screens */
@media (max-width: 700px) {
  .details-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Tree Search Box */
.tree-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.tree-search-box input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.tree-search-box input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary-light);
}

.search-result-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 1rem;
  border-radius: var(--radius-sm);
}

.search-clear-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Hidden nodes when filtering */
.tree-row.search-hidden {
  display: none !important;
}

.tree-row.search-match {
  background: var(--accent-warning-light);
}

.tree-row.search-match .tree-label {
  font-weight: 600;
}
