/* =============================================================================
   StockMaster Pro — WOW Shell (Sidebar + Density) — SAFE Overlay
   - Sidebar built from existing #desktopNav (no backend dependency)
   - Desktop only (>=1100px)
   ============================================================================= */

:root{
  --wow-side-w: 276px;
  --wow-side-w-collapsed: 86px;
  --wow-top-h: 64px;
}

@media (min-width: 1100px){
  body.wow-shell{
    padding-left: var(--wow-side-w);
  }
  body.wow-shell.wow-side-collapsed{
    padding-left: var(--wow-side-w-collapsed);
  }

  /* Hide horizontal desktop nav when sidebar is active */
  body.wow-shell #desktopNav{ display:none !important; }

  /* Make header align with sidebar */
  body.wow-shell #appHeader{
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: var(--wow-top-h);
  }

  .wow-sidebar{
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--wow-side-w);
    z-index: 50;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255,255,255,.55);
    border-right: 1px solid rgba(0,0,0,.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  body.wow-shell.wow-side-collapsed .wow-sidebar{ width: var(--wow-side-w-collapsed); }

  .wow-side-brand{
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255,255,255,.60);
    border: 1px solid rgba(0,0,0,.08);
  }
  .wow-side-logo{
    width: 40px; height: 40px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--wow-accent, #00c8ff), var(--wow-accent-2, #00ffa6));
    box-shadow: 0 10px 24px rgba(0,200,255,.18);
  }
  .wow-side-title{ font-weight: 800; line-height: 1.05; }
  .wow-side-sub{ font-size: 12px; color: rgba(11,34,54,.65); }

  body.wow-shell.wow-side-collapsed .wow-side-title,
  body.wow-shell.wow-side-collapsed .wow-side-sub{ display:none; }

  .wow-side-actions{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
  }
  .wow-icon-btn{
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(255,255,255,.55);
    color: rgba(11,34,54,.70);
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  }
  .wow-icon-btn:hover{
    transform: translateY(-1px);
    background: rgba(0,200,255,.10);
    box-shadow: 0 12px 28px rgba(0,200,255,.12);
  }

  .wow-side-nav{
    display:flex;
    flex-direction:column;
    gap: 6px;
    overflow:auto;
    padding-right: 2px;
  }

  .wow-side-item{
    display:flex;
    align-items:center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    text-decoration:none;
    color: inherit;
    border: 1px solid transparent;
    transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  }
  .wow-side-item:hover{
    background: rgba(0,200,255,.08);
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(0,200,255,.12);
  }
  .wow-side-item.active{
    background: rgba(0,200,255,.14);
    border-color: rgba(0,200,255,.18);
  }

  .wow-side-icon{
    width: 32px;
    height: 32px;
    border-radius: 12px;
    background: rgba(255,255,255,.55);
    border: 1px solid rgba(0,0,0,.06);
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
  }
  .wow-side-label{ font-weight: 600; }
  body.wow-shell.wow-side-collapsed .wow-side-label{ display:none; }

  .wow-side-badge{
    margin-left:auto;
    background: rgba(255,71,87,.14);
    border: 1px solid rgba(255,71,87,.25);
    color: #c71f2d;
    font-size: 12px;
    font-weight: 800;
    border-radius: 999px;
    padding: 2px 8px;
  }
  body.wow-shell.wow-side-collapsed .wow-side-badge{ display:none; }
}

/* Dark theme: keep readable */
html[data-theme="dark"] .wow-sidebar{
  background: rgba(8, 14, 22, .55);
  border-right: 1px solid rgba(255,255,255,.10);
}
html[data-theme="dark"] .wow-side-brand{
  background: rgba(10, 18, 28, .55);
  border-color: rgba(255,255,255,.10);
}
html[data-theme="dark"] .wow-icon-btn{
  background: rgba(10, 18, 28, .45);
  border-color: rgba(255,255,255,.10);
  color: rgba(255,255,255,.70);
}
html[data-theme="dark"] .wow-side-item:hover{ background: rgba(0,200,255,.10); }
html[data-theme="dark"] .wow-side-item.active{ background: rgba(0,200,255,.16); }

/* Density (SAFE, progressive) */
body[data-density="compact"] .page-body,
body[data-density="compact"] .pg,
body[data-density="compact"] .page-sect{
  padding: 12px 14px !important;
}
body[data-density="compact"] .sect-toolbar,
body[data-density="compact"] .mv-header,
body[data-density="compact"] .mv-actions{
  gap: 8px !important;
}
body[data-density="compact"] .card,
body[data-density="compact"] .panel,
body[data-density="compact"] .page-sect,
body[data-density="compact"] .mv-table-card{
  border-radius: 14px;
}
body[data-density="compact"] .btn{ padding: 9px 12px !important; }
body[data-density="compact"] input,
body[data-density="compact"] select,
body[data-density="compact"] textarea{
  padding-top: 9px !important;
  padding-bottom: 9px !important;
}
