/* layout.css — Sage Brand v2 App Layout */

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── App Shell ─── */
.app-container {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--color-sidebar);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 0.2s ease;
}

/* Sidebar Header */
.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-md);
  color: white;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.sidebar-logo-text span {
  color: var(--color-accent);
}

/* Show Selector */
.show-selector-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
  display: block;
}

.show-selector {
  width: 100%;
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--font-size-md);
  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 12 12'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

.show-selector:focus {
  outline: none;
  border-color: var(--color-primary);
}

/* ─── Sidebar Navigation ─── */
.sidebar-nav {
  flex: 1;
  padding: var(--space-sm) 0;
  overflow-y: auto;
}

.sidebar-phase {
  padding: var(--space-md) 0 var(--space-xs);
}

.sidebar-phase-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 var(--space-lg);
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.phase-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.phase-dot--pre-prod {
  background: var(--color-pre-prod);
}

.phase-dot--production {
  background: var(--color-production);
}

.phase-dot--post-prod {
  background: var(--color-post-prod);
}

.sidebar-nav-list {
  list-style: none;
}

.sidebar-nav-item a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.5rem var(--space-lg);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: var(--font-size-md);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.sidebar-nav-item a:hover {
  color: var(--color-text);
  background: rgba(12, 82, 178, 0.15);
}

.sidebar-nav-item a.active {
  color: var(--color-text);
  background: rgba(12, 82, 178, 0.25);
  border-left-color: var(--color-accent);
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

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

/* ─── Sidebar Footer ─── */
.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.sidebar-version {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ─── Main Content Area ─── */
.main-content {
  flex: 1;
  overflow-y: auto;
  background: var(--color-bg);
  padding: var(--space-xl);
}

/* ─── Responsive: sidebar collapses at < 1024px ─── */
@media (max-width: 1024px) {
  .sidebar {
    width: 60px;
  }

  .sidebar-logo-text,
  .show-selector-label,
  .show-selector,
  .sidebar-phase-label,
  .sidebar-nav-item a span,
  .sidebar-version {
    display: none;
  }

  .sidebar-logo {
    justify-content: center;
  }

  .sidebar-nav-item a {
    justify-content: center;
    padding: 0.6rem;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .sidebar-nav-item a.active {
    border-left: none;
    border-bottom-color: var(--color-accent);
  }

  .sidebar-phase {
    padding: var(--space-xs) 0;
  }

  .main-content {
    padding: var(--space-lg);
  }
}
