/* =========================================================
   Layout — Clean App Shell (V5.0 - PROFESSIONAL MINIMAL)
   ========================================================= */

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

body { 
  font-family: var(--font-main); 
  background: var(--bg-app); 
  color: var(--text-primary); 
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* --- Clean Flat Sidebar --- */
.sidebar {
  width: 260px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--sp-6) var(--sp-4);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  z-index: 100;
  flex-shrink: 0;
  transition: transform var(--duration-normal) var(--ease-premium);
}

.sidebar-logo {
  padding: var(--sp-2) var(--sp-4) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.sidebar-logo img {
  width: 40px; 
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--neutral-900);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

/* --- Sidebar Menu Section --- */
.sidebar-section { 
  margin-top: var(--sp-4); 
}

.sidebar-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--neutral-400);
  padding: 0 var(--sp-4);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- Sidebar Nav Item with complete State System --- */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.875rem;
  transition: all var(--duration-fast) var(--ease-premium);
  margin-bottom: 2px;
  border: 1px solid transparent;
}

/* Hover state */
.sidebar-nav-item:hover {
  background: var(--neutral-100);
  color: var(--neutral-900);
}

/* Active state (Pressed) */
.sidebar-nav-item:active {
  transform: translateY(1px);
}

/* Selected active page state (Flat, clean, NO side-stripes) */
.sidebar-nav-item.active {
  background: var(--color-primary-50);
  color: var(--color-primary-600);
  border-color: var(--color-primary-100);
  font-weight: 700;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Sidebar Footer & User Profile --- */
.sidebar-footer { 
  margin-top: auto; 
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-default); 
}

.sidebar-user { 
  display: flex; 
  align-items: center; 
  gap: var(--sp-3); 
}

.sidebar-user-info { 
  flex: 1; 
  min-width: 0; 
}

.sidebar-user-name { 
  font-weight: 700; 
  font-size: 0.875rem; 
  color: var(--neutral-900); 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
}

.sidebar-user-role { 
  font-size: 0.75rem; 
  color: var(--text-secondary); 
  font-weight: 500; 
}

.btn-logout {
  width: 36px; 
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--neutral-100);
  color: var(--neutral-600);
  display: flex; 
  align-items: center; 
  justify-content: center;
  transition: all var(--duration-fast) var(--ease-premium);
  border: none; 
  cursor: pointer;
}

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

.btn-logout:active {
  transform: translateY(1px);
}

/* --- Main Content Shell --- */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  background: var(--bg-app);
}

.page-header {
  padding: var(--sp-6) var(--sp-8);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-body {
  padding: var(--sp-8);
  flex: 1;
}

/* --- Auth Layout (Login/Register) without noisy blur blobs --- */
.auth-page {
  background: var(--bg-app);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  position: relative;
}

.auth-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 440px;
  padding: var(--sp-10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-default);
  position: relative;
  z-index: 10;
}

.auth-header {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-4);
}

.auth-logo img {
  width: 64px; 
  height: 64px;
  object-fit: contain;
}

/* --- Responsive Navigation Drawer Architecture --- */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .page-header {
    padding: var(--sp-4) var(--sp-6);
  }

  .page-body {
    padding: var(--sp-4);
  }
}

