/* 
 * RMCPro v3.1 — Codename: NEO
 * Layout Architecture & App Shell
 */

body {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  background-color: var(--bg-body);
}

/* ==========================================================================
   APP SHELL
   ========================================================================== */
.app-shell {
  display: flex;
  width: 100vw;
  height: 100dvh;
  position: relative;
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; 
  background-color: transparent;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   TOPBAR (Floating & Glassmorphism)
   ========================================================================== */
.topbar {
  height: 72px;
  background-color: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  flex-shrink: 0;
  z-index: 40;
  position: sticky;
  top: 0;
  border-bottom: 1px solid var(--border-light);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.topbar-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ==========================================================================
   VIEW CONTAINER (Page Router)
   ========================================================================== */
.view-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-6);
  position: relative;
  scroll-behavior: smooth;
}

/* Individual Views */
.view {
  display: none;
  animation: fadeIn var(--transition-normal) forwards;
  max-width: 1400px;
  margin: 0 auto;
}

.view.active {
  display: block;
}

/* ==========================================================================
   BENTO GRID UTILITY (New for NEO)
   ========================================================================== */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.bento-col-12 { grid-column: span 12; }
.bento-col-8  { grid-column: span 8; }
.bento-col-6  { grid-column: span 6; }
.bento-col-4  { grid-column: span 4; }
.bento-col-3  { grid-column: span 3; }

/* ==========================================================================
   WORKSPACE LAYOUT (Costing Calculator)
   ========================================================================== */
.workspace-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: var(--space-6);
  align-items: start;
}

.workspace-sidebar {
  position: sticky;
  top: var(--space-6);
}

/* ==========================================================================
   RESPONSIVE (Mobile First Adjustments)
   ========================================================================== */
@media (max-width: 1024px) {
  .bento-col-8, .bento-col-6, .bento-col-4, .bento-col-3 {
    grid-column: span 12;
  }
  
  .workspace-layout {
    grid-template-columns: 1fr;
  }
  
  .workspace-sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 0 var(--space-4);
    height: 64px;
  }
  .view-container {
    padding: var(--space-4);
  }
}
