/* shell.css — app shell layout: aurora bg, brand-mark, sidebar, topbar,
   page transitions. Stacked on top of voltstock-base.css. */

/* ── Aurora background ── */
.aurora {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background: var(--vs-bg);
}
.aurora::before,
.aurora::after,
.aurora .blob {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  mix-blend-mode: screen;
}
.aurora::before {
  width: 50vmax; height: 50vmax;
  top: -10vmax; left: -10vmax;
  background: radial-gradient(circle, var(--vs-accent), transparent 70%);
  animation: aurora-float-1 18s var(--vs-ease-out) infinite alternate;
}
.aurora::after {
  width: 40vmax; height: 40vmax;
  bottom: -10vmax; right: -10vmax;
  background: radial-gradient(circle, var(--vs-electric), transparent 70%);
  animation: aurora-float-2 22s var(--vs-ease-out) infinite alternate;
  opacity: 0.35;
}
.aurora .blob {
  width: 35vmax; height: 35vmax;
  top: 30%; left: 35%;
  background: radial-gradient(circle, var(--vs-mp-prom, #4A8BFF), transparent 70%);
  animation: aurora-float-3 26s var(--vs-ease-out) infinite alternate;
  opacity: 0.25;
}

@keyframes aurora-float-1 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(15vmax, 10vmax) scale(1.2); }
}
@keyframes aurora-float-2 {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-12vmax, -8vmax) scale(1.15); }
}
@keyframes aurora-float-3 {
  from { transform: translate(-10vmax, -5vmax) scale(0.9); }
  to   { transform: translate(8vmax, 12vmax) scale(1.1); }
}

[data-theme="light"] .aurora { background: var(--vs-bg); }
[data-theme="light"] .aurora::before,
[data-theme="light"] .aurora::after,
[data-theme="light"] .aurora .blob {
  opacity: 0.25;
  filter: blur(140px);
}

/* ── Brand mark (A logo) ── */
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border-radius: var(--vs-radius-md);
  background: linear-gradient(135deg, var(--vs-accent), var(--vs-accent-bright));
  color: #001b10;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 24px var(--vs-accent-glow), inset 0 -2px 4px rgba(0,0,0,.15);
  position: relative;
  user-select: none;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.18), transparent 40%);
  pointer-events: none;
}
.brand-mark-sm { width: 32px; height: 32px; font-size: 16px; border-radius: var(--vs-radius-sm); }
.brand-mark-lg { width: 72px; height: 72px; font-size: 32px; border-radius: var(--vs-radius-lg); }

.brand-name {
  font-family: var(--vs-font-sans);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--vs-text-primary);
}
.brand-name em {
  font-style: normal;
  color: var(--vs-accent);
  font-weight: 700;
}

/* ── Page enter loader ── */
.page-enter {
  position: fixed;
  inset: 0;
  background: var(--vs-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: page-fade-out 0.4s ease 0.6s forwards;
}
.page-enter-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: page-loader-pulse 1.2s ease infinite;
}
.page-enter .brand-mark { animation: page-loader-bob 2s ease-in-out infinite; }
.page-enter-label {
  font-family: var(--vs-font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--vs-text-tertiary);
}
@keyframes page-loader-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes page-loader-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
@keyframes page-fade-out {
  to { opacity: 0; visibility: hidden; }
}

/* ── App shell ── */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 60px 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar content";
  height: 100vh;
  overflow: hidden;
}
.app-shell #sidebar { grid-area: sidebar; }
.app-shell #topbar  { grid-area: topbar; }
.app-shell #content { grid-area: content; overflow: auto; padding: 24px; }

/* ── Sidebar (app shell variant — overrides voltstock's #sidebar) ── */
.app-shell #sidebar {
  background: var(--vs-surface);
  border-right: 1px solid var(--vs-border-subtle);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: auto;
}
.sb-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--vs-border-subtle);
}
.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: var(--vs-text-secondary);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  border-radius: var(--vs-radius-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: all var(--vs-duration-fast) var(--vs-ease-out);
  letter-spacing: -0.005em;
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--vs-text-primary);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--vs-accent-dim);
  color: var(--vs-accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--vs-accent);
  box-shadow: 0 0 12px var(--vs-accent-glow);
  border-radius: 0 2px 2px 0;
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-spacer { flex: 1; }

/* ── Topbar (app shell) ── */
.app-shell #topbar {
  background: var(--vs-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--vs-border-subtle);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
}
.topbar-breadcrumb {
  flex: 1;
  font-size: 14px;
  color: var(--vs-text-secondary);
  font-weight: 500;
}
.topbar-breadcrumb b {
  color: var(--vs-text-primary);
  font-weight: 600;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-actions .icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--vs-radius-md);
  border: 1px solid var(--vs-border-subtle);
  background: transparent;
  color: var(--vs-text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: all var(--vs-duration-fast);
}
.topbar-actions .icon-btn:hover {
  background: rgba(255,255,255,.04);
  color: var(--vs-text-primary);
  border-color: var(--vs-border-strong);
}

/* ── User menu dropdown ── */
.user-menu-wrap { position: relative; }
.user-menu-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: var(--vs-radius-md);
  border: 1px solid var(--vs-border-subtle);
  background: transparent;
  color: var(--vs-text-primary);
  cursor: pointer;
  transition: all var(--vs-duration-fast);
}
.user-menu-trigger:hover {
  background: rgba(255,255,255,.04);
  border-color: var(--vs-border-strong);
}
.user-menu-trigger .name {
  font-size: 13px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--vs-elevated);
  border: 1px solid var(--vs-border);
  border-radius: var(--vs-radius-lg);
  box-shadow: var(--vs-shadow-lg);
  padding: 6px;
  display: none;
  z-index: var(--vs-z-dropdown);
  animation: slide-up var(--vs-duration-fast);
}
.user-menu.open { display: block; }
.user-menu-header {
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--vs-border-subtle);
  margin-bottom: 4px;
}
.user-menu-header .label {
  font-size: 11px;
  color: var(--vs-text-tertiary);
  font-family: var(--vs-font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.user-menu-header .value {
  font-size: 13px;
  color: var(--vs-text-primary);
  font-weight: 500;
}
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--vs-text-primary);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  width: 100%;
  border-radius: var(--vs-radius-sm);
  cursor: pointer;
  transition: background var(--vs-duration-fast);
}
.user-menu-item:hover { background: rgba(255,255,255,.06); }
.user-menu-item.danger { color: var(--vs-danger); }
.user-menu-item .icon { width: 18px; text-align: center; }

/* ── Lang switcher ── */
.lang-switch {
  display: inline-flex;
  background: transparent;
  border: 1px solid var(--vs-border-subtle);
  border-radius: var(--vs-radius-md);
  padding: 2px;
  gap: 2px;
}
.lang-switch button {
  padding: 4px 9px;
  border: none;
  background: transparent;
  color: var(--vs-text-tertiary);
  border-radius: calc(var(--vs-radius-md) - 4px);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--vs-duration-fast);
  font-family: inherit;
}
.lang-switch button.active {
  background: var(--vs-accent-dim);
  color: var(--vs-accent);
}
.lang-switch button:hover:not(.active) { color: var(--vs-text-secondary); }

/* ── Mobile sidebar ── */
@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-areas: "topbar" "content";
  }
  .app-shell #sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 240px;
    z-index: var(--vs-z-sticky);
    transform: translateX(-100%);
    transition: transform var(--vs-duration-base) var(--vs-ease-out);
    box-shadow: var(--vs-shadow-lg);
  }
  .app-shell #sidebar.open { transform: translateX(0); }
  .sb-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
    z-index: calc(var(--vs-z-sticky) - 1);
    display: none;
  }
  .sb-backdrop.open { display: block; }
  .app-shell .menu-burger { display: inline-flex !important; }
}
.menu-burger { display: none; }

/* ── Centered auth card ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  border-radius: var(--vs-radius-xl);
  background: var(--vs-glass);
  backdrop-filter: blur(28px) saturate(140%);
  -webkit-backdrop-filter: blur(28px) saturate(140%);
  border: 1px solid var(--vs-border-default);
  box-shadow: var(--vs-shadow-lg);
}
.auth-card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  color: var(--vs-text-primary);
}
.auth-card .subtitle {
  font-size: 13px;
  color: var(--vs-text-secondary);
  margin-bottom: 24px;
}
.auth-head {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-bottom: 24px;
}
.auth-foot {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}
.auth-foot a {
  color: var(--vs-text-secondary);
  border-bottom: 1px dashed transparent;
}
.auth-foot a:hover {
  color: var(--vs-text-primary);
  border-bottom-color: var(--vs-border-strong);
}
.auth-corner {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex; align-items: center; gap: 8px;
  z-index: 10;
}

.form-row {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-row:last-child { margin-bottom: 0; }
.form-row-inline {
  flex-direction: row;
  gap: 12px;
}
.form-row-inline > * { flex: 1; }

/* ── Wizard progress ── */
.wizard-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
}
.wizard-progress .dot {
  flex: 1;
  height: 4px;
  border-radius: var(--vs-radius-full);
  background: var(--vs-border-subtle);
  transition: background var(--vs-duration-base);
}
.wizard-progress .dot.done   { background: var(--vs-accent); }
.wizard-progress .dot.active { background: var(--vs-accent-bright); }

/* ── Dashboard placeholder KPI ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.kpi-card {
  background: var(--vs-surface);
  border: 1px solid var(--vs-border-subtle);
  border-radius: var(--vs-radius-lg);
  padding: 18px 20px;
  transition: all var(--vs-duration-base) var(--vs-ease-out);
}
.kpi-card:hover {
  border-color: var(--vs-border-default);
  transform: translateY(-2px);
  box-shadow: var(--vs-shadow-md), var(--vs-shadow-glow);
}
.kpi-label {
  font-family: var(--vs-font-mono);
  font-size: 10px;
  color: var(--vs-text-tertiary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.kpi-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--vs-text-primary);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.kpi-empty {
  font-size: 12px;
  color: var(--vs-text-muted);
  margin-top: 8px;
  font-style: italic;
}

/* ── Onboarding card placeholder ── */
.onboarding-cta {
  background: linear-gradient(135deg, var(--vs-accent-dim), transparent);
  border: 1px solid var(--vs-accent-dim);
  border-radius: var(--vs-radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.onboarding-cta h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--vs-text-primary);
}
.onboarding-cta p {
  font-size: 13px;
  color: var(--vs-text-secondary);
  line-height: 1.6;
}
