/* ===== layout.css — Grid Layout, Sidebar, Main (Light Theme) ===== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: 1fr;
  height: 100vh;
  width: 100vw;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-brand .logo {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-brand .brand-text h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

.sidebar-brand .brand-text p {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);

  color: var(--text-secondary);
  transition: all var(--transition);
  margin-bottom: 2px;
  font-size: 0.9rem;
  user-select: none;
}

.nav-item.active {
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 600;
}

.nav-item .nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

.nav-item.active .nav-icon {
  color: var(--accent);
}

.nav-item .badge {
  margin-left: auto;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.sidebar-date {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 8px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}

/* ===== Main Content ===== */
.main-area {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.page-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}


.page-header {
  padding: 20px 28px 16px;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  flex-shrink: 0;
}

.page-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
}

.page-header .subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.page-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

/* ===== Stats Row ===== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.stat-card .stat-icon.blue { background: var(--accent-bg); color: var(--accent); }
.stat-card .stat-icon.green { background: var(--success-bg); color: var(--success); }
.stat-card .stat-icon.orange { background: var(--warning-bg); color: var(--warning); }
.stat-card .stat-icon.red { background: var(--danger-bg); color: var(--danger); }

.stat-card .stat-body .stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.stat-card .stat-body .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Two Column ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
  .two-col, .three-col {
    grid-template-columns: 1fr;
  }
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-content {
    padding: 16px;
  }
  .page-header {
    padding: 16px;
  }
  
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  z-index: 200;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  font-size: 0.65rem;
  color: var(--text-muted);

  transition: all var(--transition);
  user-select: none;
}

.mobile-nav-item .nav-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.mobile-nav-item.active {
  color: var(--accent);
}

.mobile-nav-item.active .nav-icon {
  color: var(--accent);
}

@media (max-width: 900px) {
  .page-content {
    padding-bottom: 70px;
  }
}