/* Premium shell — layered on style.css */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --font: "Plus Jakarta Sans", Inter, "Segoe UI", system-ui, sans-serif;
  --bg-elevated: #0f1628;
  --surface: rgba(18, 26, 43, 0.72);
  --surface-hover: rgba(24, 34, 53, 0.92);
  --glass: rgba(15, 22, 40, 0.55);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glow: rgba(59, 130, 246, 0.35);
  --glow-success: rgba(34, 197, 94, 0.28);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sidebar-w: 272px;
  --sidebar-collapsed: 76px;
  --topbar-h: 64px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

body {
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(37, 99, 235, 0.18), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(16, 185, 129, 0.1), transparent 50%),
    linear-gradient(180deg, #070b14 0%, #0d1320 45%, #101827 100%);
  color: var(--text);
}

.layout.app-shell {
  grid-template-columns: var(--sidebar-w) 1fr;
  transition: grid-template-columns 0.35s var(--ease);
}

body.sidebar-collapsed .layout.app-shell {
  grid-template-columns: var(--sidebar-collapsed) 1fr;
}

.sidebar.premium-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 16px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  box-shadow: 0 8px 24px var(--glow);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-text .brand {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-text .brand-sub {
  font-size: 0.78rem;
  margin: 2px 0 0;
  opacity: 0.75;
}

.sidebar-toggle {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, color 0.2s;
}

.sidebar-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}

body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .user-box span {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle {
  margin: 0 auto;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.nav-group {
  margin-bottom: 14px;
}

.nav-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(147, 164, 195, 0.65);
  padding: 0 12px 8px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(229, 238, 252, 0.88);
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), border-color 0.2s, transform 0.15s;
}

.sidebar nav a .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  flex-shrink: 0;
}

.sidebar nav a:hover {
  background: var(--surface-hover);
  transform: translateX(2px);
}

.sidebar nav a.active {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(37, 99, 235, 0.06));
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

.sidebar nav a.active .nav-icon {
  opacity: 1;
}

.app-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(7, 11, 20, 0.72);
  backdrop-filter: blur(14px);
}

.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.65);
  color: var(--muted);
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.topbar-search:hover,
.topbar-search:focus-visible {
  border-color: rgba(59, 130, 246, 0.4);
  background: var(--surface-hover);
  outline: none;
}

.topbar-search kbd {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--muted);
  font-family: inherit;
}

.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-wos-link {
  flex-shrink: 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.topbar-wos-link:hover,
.topbar-wos-link:focus-visible {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.45);
  outline: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: rgba(18, 26, 43, 0.8);
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px var(--glow-success);
}

.status-pill.warn::before {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

.content.app-content {
  padding: 24px 28px 56px;
  flex: 1;
}

.page-header h1 {
  font-size: clamp(1.55rem, 2vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.kpi-card,
.action-card,
.panel {
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(24, 34, 53, 0.92) 0%, rgba(18, 26, 43, 0.88) 100%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 16px 40px rgba(0, 0, 0, 0.28);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.kpi-card:hover,
.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 20px 48px rgba(0, 0, 0, 0.35);
}

.kpi-card strong {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.btn {
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.15s var(--ease), box-shadow 0.2s;
}

.btn:not(.secondary):not(.link) {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}

.btn:not(.secondary):hover {
  transform: translateY(-1px);
}

.empty-state {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.45);
}

.empty-state h2 {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.data-table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(147, 164, 195, 0.85);
}

.table-wrap {
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  overflow: auto;
}

/* Command palette */
.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
}

.cmd-palette[hidden] {
  display: none;
}

.cmd-dialog {
  width: min(560px, 100%);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 22, 40, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.cmd-input {
  width: 100%;
  padding: 16px 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.cmd-input:focus {
  outline: none;
}

.cmd-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
}

.cmd-item:hover,
.cmd-item.active {
  background: rgba(59, 130, 246, 0.15);
}

.cmd-item small {
  color: var(--muted);
  font-size: 0.75rem;
}

@media (max-width: 960px) {
  .layout.app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar.premium-sidebar {
    display: none;
  }

  .app-topbar {
    padding: 0 16px;
  }

  .content.app-content {
    padding: 16px;
  }
}

/* Unified SKU profile */
.sku-profile-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.sku-profile-eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(147, 164, 195, 0.9);
}

.sku-profile-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: min(420px, 100%);
}

.sku-profile-search {
  position: relative;
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.sku-profile-search .sku-search {
  flex: 1;
  min-width: 0;
}

.sku-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 72px;
  z-index: 40;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.96);
  padding: 6px;
}

.sku-search-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.sku-search-option:hover,
.sku-search-option.active {
  background: rgba(59, 130, 246, 0.16);
}

.sku-decision {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 8px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.55);
}

.sku-decision-label {
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sku-decision h2 {
  margin: 0 0 6px;
  font-size: 1.25rem;
}

.sku-decision-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  max-width: 460px;
}

.sku-decision-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.14);
  color: #e2e8f0;
}

.sku-decision.is-critical {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(127, 29, 29, 0.28);
}
.sku-decision.is-danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(127, 29, 29, 0.22);
}
.sku-decision.is-warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(120, 53, 15, 0.22);
}
.sku-decision.is-info {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(30, 64, 175, 0.22);
}
.sku-decision.is-ok {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(20, 83, 45, 0.22);
}

.sku-profile-empty {
  margin-top: 12px;
}

.sku-module-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.module-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.55);
  color: var(--muted);
}

.module-pill.ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

.module-pill.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fde68a;
}

.sku-profile-tabs {
  margin: 20px 0 24px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(15, 23, 42, 0.45);
}

.sku-profile-tabs .tab {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  border-radius: 10px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.sku-profile-tabs .tab:hover {
  color: var(--text);
  background: rgba(59, 130, 246, 0.1);
}

.sku-profile-tabs .tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(59, 130, 246, 0.75));
  color: #fff;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.sku-profile-kpi {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.sku-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.sku-profile-grid .detail-card,
.detail-card {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  background: rgba(18, 26, 43, 0.75);
}

.sku-profile-grid .detail-card span.muted,
.detail-card span.muted {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.sku-profile-grid .detail-card strong,
.detail-card strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head-row h2 {
  margin: 0;
}

@media (max-width: 720px) {
  .sku-profile-header .header-actions {
    width: 100%;
  }

  .sku-profile-kpi {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sku-search-results {
    right: 0;
  }
}
