/**
 * Antigravity Engine - Design System v3.0 (Quantum Upgrade)
 * Concept: "Deep Space Glass"
 * Focus: High Contrast, Precision, Performance
 */

/* =============================================================================
   1. TOKENS & VARIABLES
   ============================================================================= */

   :root {
    /* --- COLOR PALETTE (Deep Space) --- */
    --bg-app: #050505;          /* Absolute Zero */
    --bg-panel: #0E0E10;        /* Panel Background */
    --bg-card: rgba(18, 18, 20, 0.7); /* Translucent Card */
    --bg-elevated: #18181b;     /* Hover states */
    
    /* --- GLASSMORPHISM --- */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.03);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
    --backdrop-blur: blur(12px);
  
    /* --- ACCENTS (Neon Precision) --- */
    --primary: #4ade80;        /* Tech Blue */
    --primary-glow: rgba(74, 222, 128, 0.5);
    
    --success: #10b981;        /* Signal Green */
    --success-bg: rgba(16, 185, 129, 0.1);
    
    --warning: #f59e0b;        /* Alert Amber */
    --warning-bg: rgba(245, 158, 11, 0.1);
    
    --danger: #ef4444;         /* Critical Red */
    --danger-bg: rgba(239, 68, 68, 0.1);
  
    /* --- TYPOGRAPHY --- */
    --font-heading: 'Inter', -apple-system, sans-serif;
    --font-ui: 'Inter', -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    
    --text-1: #ffffff;
    --text-2: #a1a1aa;
    --text-3: #52525b;
  
    /* --- METRICS --- */
    --radius-s: 4px;
    --radius-m: 8px;
    --radius-l: 12px;
    --radius-xl: 16px;
  
    --space-2: 0.5rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
  
    /* --- ANIMATION --- */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  }
  
  /* =============================================================================
     2. RESET & GLOBAL
     ============================================================================= */
  
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  body {
    background-color: var(--bg-app);
    color: var(--text-2);
    font-family: var(--font-ui);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow-x: hidden; /* Solo bloquear scroll horizontal */
    display: flex;
  }
  
  /* Scrollbar Polish */
  ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  ::-webkit-scrollbar-track {
    background: transparent;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 3px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-3);
  }
  
  h1, h2, h3, h4 {
    color: var(--text-1);
    font-weight: 600;
    letter-spacing: -0.02em;
  }
  
  /* =============================================================================
     3. LAYOUT STRUCTURE
     ============================================================================= */
  
  .sidebar {
    width: 64px; /* Default collapsed state for modern look, or 240px if expanded */
    min-width: 240px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 50;
    transition: width 0.3s var(--ease-out);
  }
  
  .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto; /* Permitir scroll vertical */
    background: linear-gradient(180deg, rgba(255,255,255,0.01) 0%, transparent 100%);
  }
  
  .scroll-container {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-8);
  }
  
  .max-width-wrapper {
    max-width: 1100px;
    margin: 0 auto;
  }

  /* --- RESTORED CLASSES (UX Emergency Fix) --- */
  .views-container {
    padding: 32px;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 64px);
  }

  .glass-panel {
    background: rgba(18, 18, 20, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px;
  }
  
  /* =============================================================================
     4. COMPONENTS: SIDEBAR
     ============================================================================= */
  
  .brand {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 var(--space-4);
    border-bottom: 1px solid var(--glass-border);
  }
  
  .brand-logo {
    height: 28px;
    filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.4));
  }

  .brand-logo-full {
      height: 48px; /* Increased to 48px */
      width: auto;
      filter: drop-shadow(0 0 8px rgba(74, 222, 128, 0.15));
      transform: translateY(-2px); /* Lift slightly to align text baseline with header */
  }
  
  .nav-menu {
    flex: 1;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    border-radius: var(--radius-m);
    color: var(--text-2);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    font-weight: 500;
  }
  
  .nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-1);
  }
  
  .nav-item.active {
    background: rgba(74, 222, 128, 0.1);
    color: var(--primary);
    box-shadow: inset 0 0 0 1px rgba(74, 222, 128, 0.2);
  }
  
  .nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
  }
  
  .nav-separator {
    height: 1px;
    background: var(--glass-border);
    margin: 8px 0;
  }
  
  .sidebar-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--glass-border);
    font-size: 0.75rem;
    color: var(--text-3);
    text-align: center;
  }
  
  /* =============================================================================
     5. COMPONENTS: HEADER & TOP BAR
     ============================================================================= */
  
  .header {
    height: 64px;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-8);
    background: rgba(5, 5, 5, 0.8); /* Semi-transparent */
    backdrop-filter: var(--backdrop-blur);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 40;
  }
  
  .header-info h1 {
    font-size: 1rem;
    color: var(--text-2);
    font-weight: 400;
  }
  
  .header-info strong {
    color: var(--text-1);
    font-weight: 600;
  }
  
  .header-actions-group {
    display: flex;
    gap: var(--space-2);
    align-items: center;
  }
  
  /* =============================================================================
     6. COMPONENTS: CARDS & CONTAINERS
     ============================================================================= */
  
  .section {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  }
  
  .section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
  }
  
  .section-header {
    margin-bottom: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
  
  .section-header h2 {
    font-size: 1.5rem;
    background: linear-gradient(to right, #fff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  
  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
  }
  
  .card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: var(--space-4);
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
    overflow: hidden;
  }
  
  .card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
  }
  
  /* =============================================================================
     7. COMPONENTS: INPUTS & FORMS
     ============================================================================= */
  
  .input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: var(--space-2);
  }
  
  .input-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  .input {
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    color: var(--text-1);
    padding: 10px 12px;
    border-radius: var(--radius-m);
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
  }
  
  .input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
  }
  
  /* Select specific generic fixes */
  select.input {
    appearance: none;
    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='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
  }
  
  /* =============================================================================
     8. COMPONENTS: BUTTONS
     ============================================================================= */
  
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-m);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
  }
  
  .btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
  }
  
  .btn-primary:hover {
    background: #22c55e;  /* Green hover (v9.6 Protocol) */
  }
  
  .btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-1);
    border-color: var(--glass-border);
  }
  
  .btn-secondary:hover {
    background: rgba(255,255,255,0.1);
  }
  
  .btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
  }
  
  .btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
  }
  
  /* =============================================================================
     9. COMPONENTS: VISUALIZATIONS & RESULTS
     ============================================================================= */
  
  .result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: var(--bg-panel);
    border-radius: var(--radius-l);
    border: 1px solid var(--glass-border);
  }
  
  .result-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.2;
  }
  
  .result-unit {
    font-size: 0.875rem;
    color: var(--text-3);
  }
  
  .status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 99px;
    background: var(--bg-elevated);
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--glass-border);
  }
  
  .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
  }
  
  /* =============================================================================
     10. SPECIFIC: LAYERS
     ============================================================================= */
  
  .layer-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-m);
    margin-bottom: var(--space-2);
  }
  
  .layer-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border-radius: 50%;
    color: var(--text-2);
    font-weight: 600;
    flex-shrink: 0;
  }
  
  /* Compatibility with existing JS classes */
  .layers-container { display: flex; flex-direction: column; }
  .structure-section { width: 100%; border-top: 1px dashed var(--glass-border); margin-top: 12px; padding-top: 12px; }
  
  /* =============================================================================
     11. ALERTS & NOTIFICATIONS
     ============================================================================= */
  
  .compliance-banner {
    padding: var(--space-4);
    border-radius: var(--radius-m);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    font-weight: 500;
  }
  
  .compliance-banner.success {
    background: var(--success-bg);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: var(--success);
  }
  
  .compliance-banner.error {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
  }
  
  /* =============================================================================
     12. UTILITIES
     ============================================================================= */
  
  .hidden { display: none !important; }
  .w-full { width: 100%; }
  .mt-4 { margin-top: 1rem; }
  .flex { display: flex; }
  .gap-2 { gap: 0.5rem; }
  
  /* Responsive */
  @media (max-width: 768px) {
    .sidebar { position: fixed; transform: translateX(-100%); width: 240px; height: 100%; }
    .sidebar.open { transform: translateX(0); }
    .header { padding: 0 var(--space-4); }
  }

  /* =============================================================================
     13. PHASE 38-39: INTELLIGENCE DASHBOARD
     ============================================================================= */

  .intel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-6);
  }

  .intel-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
  }
  
  .intel-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .intel-card.financial { border-left: 4px solid var(--success); }
  .intel-card.hvac { border-left: 4px solid var(--primary); }
  
  /* Loading State (Skeleton) */
  .intel-card.loading {
    opacity: 0.7;
    pointer-events: none;
  }
  .intel-card.loading .intel-stats, 
  .intel-card.loading .intel-header h3,
  .intel-card.loading .rec-box {
    filter: blur(4px);
    transition: filter 0.3s;
  }
  .intel-card.loading::after {
    content: "Analizando...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-1);
    background: rgba(0,0,0,0.7);
    padding: 8px 16px;
    border-radius: 20px;
    z-index: 10;
  }

  .intel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
  }

  .intel-header h3 { font-size: 1rem; margin: 0; }
  
  .intel-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
  }
  .intel-badge.financial { background: rgba(16, 185, 129, 0.15); color: var(--success); }
  .intel-badge.hvac { background: rgba(74, 222, 128, 0.15); color: var(--primary); }

  .intel-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
  }

  .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
    padding-bottom: 4px;
  }
  .stat-row:last-child { border-bottom: none; }

  .stat-val { font-family: var(--font-mono); font-weight: 600; }
  .stat-val.highlight { color: var(--success); }
  
  .rec-box {
    text-align: center;
    background: rgba(74, 222, 128, 0.05);
    padding: 10px;
    border-radius: var(--radius-m);
    margin: 8px 0;
    border: 1px solid rgba(74, 222, 128, 0.1);
  }
  .rec-val { font-size: 1.2rem; font-weight: 700; color: var(--primary); display: block; }
  .rec-label { font-size: 0.7rem; color: var(--text-3); text-transform: uppercase; }

  .intel-note {
    font-size: 0.7rem;
    color: var(--text-3);
    margin-top: var(--space-4);
    font-style: italic;
  }

  /* =============================================================================
     14. REPORT DROPDOWN (Moved from index.html)
     ============================================================================= */
     
  .report-dropdown-container { position: relative; }
  
  .report-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 260px;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    padding: 8px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--glass-shadow);
    z-index: 100;
    transform-origin: bottom left;
    animation: slideUp 0.2s var(--ease-out);
  }
  @keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  
  .report-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-m);
    color: var(--text-1);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
  }
  .report-option:hover { background: var(--bg-elevated); border-color: rgba(255,255,255,0.1); }
  .report-option .icon { font-size: 1.2rem; }
  .report-option .text { display: flex; flex-direction: column; }
  .report-option .title { font-weight: 600; font-size: 0.85rem; color: var(--text-1); }
  .report-option .desc { font-size: 0.7rem; color: var(--text-2); }

  .report-option.active { background: var(--bg-elevated); border-left: 3px solid var(--primary); }
  
  /* Facade Description */
  .facade-desc { font-size: 0.9rem; color: var(--text-2); margin-bottom: 12px; }

  /* Stat Row Separator */
  .stat-row.separator { margin-top: 4px; border-top: 1px dashed var(--glass-border); padding-top: 4px; }
  
  /* Status Indicator Variants */
  .status-indicator.success { background: var(--success-bg); color: var(--success); }
  .status-indicator.error { background: var(--danger-bg); color: var(--danger); }

  /* =============================================================================
     15. PHASE 35: FACADE ANALYSIS
     ============================================================================= */
  
  .facade-card {
    margin-top: var(--space-6);
    border-left: 4px solid var(--primary); /* Was --accent-sub, mapped to primary */
  }

  .wwr-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 
    gap: 12px;
  }

  .wwr-item {
    background: var(--bg-elevated);
    padding: 10px;
    border-radius: var(--radius-m);
    border: 1px solid transparent;
  }
  
  .wwr-item-header { font-weight: 700; margin-bottom: 4px; display: flex; justify-content: space-between; }
  .wwr-item-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
  .wwr-limit { font-size: 0.8em; color: var(--text-3); }
  
  .wwr-rec {
    margin-top: 6px;
    padding: 6px;
    background: var(--danger-bg);
    color: var(--danger);
    font-size: 0.8em;
    border-radius: 4px;
    line-height: 1.2;
  }
  
  .wwr-global {
    margin-top: 10px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-2);
  }

  /* =============================================================================
     16. INNOVATION: PRO TOOLTIPS (Phase 50)
     ============================================================================= */
  
  [data-tooltip] {
    position: relative;
    cursor: help;
    text-decoration: underline dotted var(--text-2);
  }

  [data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    width: max-content;
    max-width: 250px;
    padding: 8px 12px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(8px);
    color: var(--text-1);
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    border-radius: var(--radius-m);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease-out);
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  }

  [data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    border: 6px solid transparent;
    border-top-color: rgba(10, 10, 10, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s var(--ease-out);
    pointer-events: none;
    z-index: 1000;
  }

  [data-tooltip]:hover::before,
  [data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-12px);
  }
  
  /* Copy Feedback */
  .copy-feedback {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--success);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-m);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s var(--ease-out);
    z-index: 2000;
    font-weight: 600;
  }
  .copy-feedback.show {
    transform: translateY(0);
    opacity: 1;
  }

  /* =============================================================================
     17. ZEN MODE (Focus)
     ============================================================================= */
     
  body.zen-mode .sidebar { transform: translateX(-100%); transition: transform 0.4s ease; }
  body.zen-mode .main-content { margin-left: 0; width: 100%; transition: margin 0.4s ease; }
  body.zen-mode .header { opacity: 0; pointer-events: none; height: 0; overflow: hidden; }
  
  /* Floating Toggle for Zen Mode exit */
  .zen-exit-btn {
      position: fixed;
      bottom: 20px;
      left: 20px;
      width: 40px;
      height: 40px;
      background: var(--bg-elevated);
      border: 1px solid var(--glass-border);
      border-radius: 50%;
      display: none;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 9999;
      opacity: 0.6;
      transition: opacity 0.2s;
  }
  body.zen-mode .zen-exit-btn { display: flex; }
  .zen-exit-btn:hover { opacity: 1; background: var(--primary-glow); }

/* =============================================================================
   18. UX CRITICAL FIXES (v9.7 Audit)
   Fixes Issues #1-5 from Design Red Team Audit
   ============================================================================= */

/* --- ISSUE #1: Header Typography Fix --- */
.header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.header-info h1 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.2;
  white-space: nowrap;
  margin: 0;
}

.header-subtitle {
  font-size: 0.7rem;
  color: var(--text-3);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  margin: 0;
}

/* --- ISSUE #2: Tab Affordance (Muro/Techo/Piso) --- */
.tab-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--glass-border);
}

.btn-xs,
.tab-btn {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
}

.btn-xs:hover,
.tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
}

.btn-xs.active,
.tab-btn.active {
  background: var(--primary);
  color: #0a0a0a;
  box-shadow: 0 2px 8px rgba(74, 222, 128, 0.25);
}

/* --- HEADER CONTROLS UNIFICATION (Step 19) --- */
.header-controls-row .tab-group {
    height: 32px;
    padding: 2px; /* Reduced from 4px for better fit */
    display: inline-flex;
    align-items: center;
    box-sizing: border-box;
    vertical-align: middle;
}

.header-controls-row .tab-btn,
.header-controls-row .btn-primary,
.header-controls-row .btn-secondary,
.header-controls-row button {
    font-family: 'JetBrains Mono', monospace !important;
    text-transform: uppercase !important;
    font-size: 0.7rem !important;
    letter-spacing: 0.05em !important;
    font-weight: 700 !important;
    height: 100% !important; /* Adapt to container (28px inside tab-group) */
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-controls-row .btn-primary,
.header-controls-row .btn-secondary {
    height: 32px !important; /* Standalone buttons keep full height */
}

/* --- 3D Empty State (Matching Schematic) --- */

/* --- 3D Empty State (Matching Schematic) --- */
.empty-3d-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    color: #444; /* Matches schematic #666 but simpler */
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* --- ISSUE #3 & #4: Layer Table Header Row --- */
.layer-table-header {
  display: grid;
  grid-template-columns: 50px 100px 1fr 80px 80px 50px;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

.layer-table-header span {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
}

/* Layer card field labels (inline context) */
.layer-field-label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  margin-bottom: 2px;
}

/* --- ISSUE #5: Compliance Banner Upgrade --- */
.compliance-banner.error,
.compliance-banner.warning {
  background: linear-gradient(135deg, 
    rgba(239, 68, 68, 0.12), 
    rgba(239, 68, 68, 0.04));
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-left: 4px solid var(--danger);
  padding: 16px 20px;
  border-radius: 10px;
}

.compliance-banner.error .banner-icon,
.compliance-banner.warning .banner-icon {
  font-size: 1.5rem;
  color: var(--danger);
  flex-shrink: 0;
}

.compliance-banner.error h4,
.compliance-banner.warning h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--danger);
  margin: 0 0 4px 0;
}

.compliance-banner.error p,
.compliance-banner.warning p {
  font-size: 0.85rem;
  color: var(--text-2);
  margin: 0;
}

/* Success state */
.compliance-banner.success {
  background: linear-gradient(135deg, 
    rgba(16, 185, 129, 0.12), 
    rgba(16, 185, 129, 0.04));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 4px solid var(--success);
}

.compliance-banner.success .banner-icon {
  color: var(--success);
}

.compliance-banner.success h4 {
  color: var(--success);
}

/* --- Delete Button Softening (Issue #8) --- */
.btn-delete,
.layer-card .btn-icon-danger {
  opacity: 0.4;
  color: var(--text-3);
  background: transparent;
  border: none;
  transition: all 0.2s;
}

.btn-delete:hover,
.layer-card .btn-icon-danger:hover,
.layer-card:hover .btn-delete,
.layer-card:hover .btn-icon-danger {
  opacity: 1;
  color: var(--danger);
}

/* --- Empty State Design (Issue #7) --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-3);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.empty-state-hint {
  font-size: 0.75rem;
  color: var(--text-3);
  opacity: 0.7;
}

/* --- Expand Button Container (Issue #15) --- */
.visual-stage .btn-expand,
.schematic-stage .btn-expand {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-2);
}

.visual-stage .btn-expand:hover,
.schematic-stage .btn-expand:hover {
  background: rgba(0, 0, 0, 0.8);
  color: var(--text-1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* =============================================================================
   19. PRIORITY 2 UX FIXES (v9.7 Audit)
   Issues #6, #9, #10, #11, #12, #13, #14
   ============================================================================= */

/* --- ISSUE #6: Gauge & Metrics Integration --- */
.gauge-container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.gauge-visual {
  position: relative;
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.gauge-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-1);
}

.gauge-unit {
  font-size: 0.8rem;
  color: var(--text-3);
  font-weight: 400;
}

.gauge-metrics {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gauge-metric-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 6px;
  border: 1px solid var(--glass-border);
}

.gauge-metric-label {
  font-size: 0.75rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gauge-metric-value {
  font-size: 0.9rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-1);
}

.gauge-metric-value.success { color: var(--success); }
.gauge-metric-value.danger { color: var(--danger); }
.gauge-metric-value.warning { color: var(--warning); }

/* Gauge reference line */
.gauge-limit-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--danger);
  opacity: 0.6;
}

/* --- ISSUE #9: Schematic Labels (Truncation Fix) --- */
.stack-layer-name,
.schematic-label {
  display: block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.7rem;
  color: var(--text-2);
  cursor: help;
}

.stack-layer-name:hover,
.schematic-label:hover {
  overflow: visible;
  position: relative;
  z-index: 10;
}

/* Tooltip on hover for truncated labels */
.stack-layer-name::after,
.schematic-label::after {
  content: attr(data-full-name);
  position: absolute;
  left: 0;
  top: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.75rem;
  color: var(--text-1);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.stack-layer-name:hover::after,
.schematic-label:hover::after {
  opacity: 1;
  visibility: visible;
}

/* --- ISSUE #10: Dimension Colors Consistency --- */
.schematic-dimension,
.stack-dimension,
.dimension-label {
  color: var(--primary) !important; /* Use consistent green */
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
}

/* --- ISSUE #11: Asistente IA Button (Secondary) --- */
.btn-ai-assistant {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ai-assistant:hover {
  background: rgba(74, 222, 128, 0.1);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.2);
}

/* --- ISSUE #12: Sidebar Spacing Consistency --- */
.sidebar .nav-section {
  padding: 16px 12px 8px;
}

.sidebar .nav-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: 8px;
  padding: 0 8px;
}

.sidebar .nav-item {
  margin-bottom: 2px;
}

/* --- ISSUE #13: Input Focus States --- */
input:focus,
select:focus,
textarea:focus,
.layer-card input:focus,
.layer-card select:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15) !important;
}

/* Number inputs specific styling */
input[type="number"]:focus {
  background: rgba(74, 222, 128, 0.05);
}

/* --- ISSUE #14: Online Legacy Badge Rename --- */
.status-badge,
.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.status-badge::before,
.connection-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Offline state */
.status-badge.offline,
.connection-badge.offline {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

.status-badge.offline::before,
.connection-badge.offline::before {
  background: var(--danger);
  animation: none;
}

/* =============================================================================
   20. POLISH PASS (Final Consistency)
   ============================================================================= */

/* Card hover effects */
.card:hover,
.layer-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Smooth scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-panel);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) var(--bg-panel);
}

/* Link hover consistency */
a:hover {
  color: var(--primary);
  text-decoration: none;
}

/* Loading skeleton animation */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-panel) 25%,
    var(--bg-elevated) 50%,
    var(--bg-panel) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  color: var(--text-1);
  font-size: 0.85rem;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s var(--ease-out);
}

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

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }

/* =============================================================================
   21. LAYERS TABLE GRID LAYOUT (Critical Fix - Issue #LAYOUT)
   Fixes: Column headers (#, Tipo, Material, Espesor, $/m²) rendering vertically
   ============================================================================= */

/* --- Grid Column Widths (Shared by Header + Cards) --- */
:root {
  --col-drag: 24px;
  --col-num: 28px;
  --col-type: 140px;
  --col-material: 1fr;
  --col-thickness: 80px;
  --col-cost: 80px;
  --col-action: 36px;
}

/* --- Layers Header Row --- */
.layers-header {
  display: grid;
  grid-template-columns: var(--col-drag) var(--col-num) var(--col-type) var(--col-material) var(--col-thickness) var(--col-cost) var(--col-action);
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid var(--glass-border);
}

.layers-header .header-col {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Layer Card (Each Row) --- */
.layer-card {
  display: grid;
  grid-template-columns: var(--col-drag) var(--col-num) 1fr var(--col-action);
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  margin-bottom: 6px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
}

.layer-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.layer-card.has-structure {
  border-left: 3px solid var(--primary);
}

/* --- Drag Handle --- */
.layer-drag-handle {
  cursor: grab;
  color: var(--text-3);
  font-size: 1rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  user-select: none;
}

.layer-card:hover .layer-drag-handle {
  opacity: 1;
}

/* --- Layer Number Badge --- */
.layer-number {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
}

/* --- Layer Content (Main Grid Area) --- */
.layer-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* --- Primary Row: Inputs Grid --- */
.layer-primary-row {
  display: grid;
  grid-template-columns: var(--col-type) 1fr var(--col-thickness) var(--col-cost);
  gap: 8px;
  align-items: center;
}

/* --- Input Wrappers --- */
.layer-primary-row .input-wrapper {
  width: 100%;
}

.layer-primary-row .input,
.layer-primary-row select,
.layer-primary-row input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  background: var(--bg-panel);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--text-1);
  font-size: 0.8rem;
  transition: all 0.2s;
}

.layer-primary-row input[type="number"] {
  text-align: right;
  font-family: var(--font-mono);
}

.layer-primary-row .input:focus,
.layer-primary-row input:focus,
.layer-primary-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.15);
  outline: none;
}

/* --- Structure Row (Conditional) --- */
.structure-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: rgba(74, 222, 128, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(74, 222, 128, 0.15);
}

.structure-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-2);
  cursor: pointer;
}

.structure-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.structure-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Remove Button --- */
.btn-remove {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-3);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
}

.layer-card:hover .btn-remove {
  opacity: 0.6;
}

.btn-remove:hover {
  opacity: 1 !important;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* --- Sortable States --- */
.sortable-ghost {
  opacity: 0.4;
  background: var(--primary);
}

.sortable-chosen {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sortable-drag {
  background: var(--bg-elevated);
}

/* --- Empty State --- */
#layersContainer .empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
  font-size: 0.9rem;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 768px) {
  .layers-header {
    display: none; /* Hide header on mobile, use card labels instead */
  }
  
  .layer-card {
    grid-template-columns: auto 1fr auto;
  }
  
  .layer-primary-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .layer-primary-row .input-wrapper::before {
    content: attr(data-label);
    display: block;
    font-size: 0.65rem;
    color: var(--text-3);
    text-transform: uppercase;
    margin-bottom: 4px;
  }
}

/* =============================================================================
   22. CONSTRUCTORA LAYOUT STABILIZATION (Design Red Team Fix v3)
   Purpose: Force consistent full-width layout regardless of content state
   Root Cause Fixed: Parent containers were collapsing on empty state
   HIERARCHY FIX: All parent levels must be width: 100%
   ============================================================================= */

/* CRITICAL: Force ALL parent containers to always be full width */
.sections-container {
  width: 100% !important;
  display: block;
}

.section {
  width: 100% !important;
  display: none;
}

.section.active {
  display: block !important;
  width: 100% !important;
}

#section-layers {
  width: 100% !important;
}

/* Main Grid Container - FIXED PROPORTIONS */
.constructora-layout {
  display: grid;
  grid-template-columns: 35% 65%;  /* Fixed proportions */
  gap: 24px;
  min-width: 900px;
  width: 100%;
  box-sizing: border-box;
}

/* Visual Column (Left) - Fixed Proportion */
.constructora-layout > div:first-child {
  min-width: 320px;
  flex-shrink: 0;
}

/* Layers Panel (Right) - ALWAYS SAME WIDTH */
.constructora-layout .lab-bench {
  min-width: 520px;
  width: 100%;
  box-sizing: border-box;
}

/* Layers Container - Force consistent height & width */
#layersContainer {
  min-height: 320px;
  width: 100%;
}

/* Empty State Enhancement - Force same size as populated state */
#layersContainer .empty-state {
  min-height: 280px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 40px 24px;
  text-align: center;
  color: var(--text-3);
  font-size: 0.9rem;
  box-sizing: border-box;
}

#layersContainer .empty-state::before {
  content: '📐';
  font-size: 2.5rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1024px) {
  .constructora-layout {
    grid-template-columns: 1fr;
    min-width: auto;
  }
  
  .constructora-layout > div:first-child {
    width: 100%;
    min-width: auto;
    height: 400px;
  }
  
  .constructora-layout .lab-bench {
    min-width: auto;
  }
}



/* =============================================================================
   16. USER DROPDOWN (Sprint v9.9.15)
   ============================================================================= */

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

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: var(--bg-panel);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-l);
    box-shadow: var(--glass-shadow);
    padding: var(--space-4);
    z-index: 1000;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: fadeSlideDown 0.2s ease-out;
}

.user-dropdown-menu.hidden {
    display: none;
}

.dropdown-header {
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.dropdown-label {
    font-size: 0.75rem;
    color: var(--text-3);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.dropdown-email {
    font-weight: 600;
    color: var(--text-1);
    font-size: 0.9rem;
    word-break: break-all;
}

.dropdown-plan {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    font-weight: 600;
}

.dropdown-plan.badge-pro {
    background: rgba(74, 222, 128, 0.1);
    color: var(--primary);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.dropdown-plan.badge-trial {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.dropdown-plan.badge-advanced {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.dropdown-plan.badge-team {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.dropdown-plan.badge-enterprise {
    background: rgba(236, 72, 153, 0.12);
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.dropdown-plan.badge-expired {
    background: rgba(107, 114, 128, 0.12);
    color: #6b7280;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.dropdown-plan.badge-local {
    background: rgba(161, 161, 170, 0.1);
    color: var(--text-2);
}

.dropdown-actions {
    display: flex;
    flex-direction: column;
}

.btn-logout {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--danger);
    border: 1px solid transparent;
    padding: 8px;
    border-radius: var(--radius-m);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: var(--danger-bg);
}

.btn-plan {
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--text-1);
    border: 1px solid transparent;
    padding: 8px;
    border-radius: var(--radius-m);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-plan:hover {
    background: rgba(255, 255, 255, 0.05);
}

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



/* PWA Update Banner */
.pwa-update-banner {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  max-width: 360px;
  color: #e5e7eb;
}

.pwa-update-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pwa-update-text strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.pwa-update-text span {
  font-size: 0.8rem;
  color: #9ca3af;
}

.pwa-update-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .pwa-update-banner {
    right: 16px;
    left: 16px;
    bottom: 16px;
    max-width: none;
  }

  .pwa-update-actions {
    justify-content: space-between;
  }
}
