/* ===================================
   LAYOUT.CSS — Sidebar, Header, Grid
   =================================== */

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

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-lg);
  border-bottom: 1px solid var(--border-light);
}

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

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow-blue);
}

.sidebar-logo .logo-text {
  font-size: var(--fs-lg); font-weight: 700;
  color: var(--text-primary);
}

.sidebar-logo .logo-sub {
  font-size: var(--fs-xs); color: var(--text-muted);
  display: block; line-height: 1.2;
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
}

.nav-section-label {
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: var(--space-sm) var(--space-md);
  margin-top: var(--space-lg);
}
.nav-section-label:first-child { margin-top: 0; }

.nav-item {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--fs-base); font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer; margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.08);
}

.nav-item.active {
  color: var(--accent-blue-light);
  background: rgba(59, 130, 246, 0.12);
}

.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  background: var(--accent-blue);
  border-radius: var(--radius-full);
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--accent-red);
  color: white; font-size: var(--fs-xs); font-weight: 600;
  padding: 2px 8px; border-radius: var(--radius-full);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border-light);
}

.sidebar-user {
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-sm); border-radius: var(--radius-md);
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-amber), var(--accent-red));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: var(--fs-sm); flex-shrink: 0;
}

.user-name { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.user-role { font-size: var(--fs-xs); color: var(--text-muted); }

/* --- Main Content --- */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* --- Header --- */
.top-header {
  height: var(--header-height);
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--space-xl);
  position: sticky; top: 0; z-index: 50;
}

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

.header-title {
  font-size: var(--fs-xl); font-weight: 700;
  color: var(--text-heading);
}

.header-subtitle { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }

.header-search { position: relative; }

.header-search input {
  width: 280px; padding: 9px 16px 9px 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-primary); font-size: var(--fs-sm);
  transition: all var(--transition-fast);
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  width: 340px;
}

.header-search .search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted);
}

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

.header-btn {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}
.header-btn:hover { background: var(--bg-secondary); color: var(--text-primary); }

.header-btn .notif-dot {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px;
  background: var(--accent-red); border-radius: 50%;
}

.header-date {
  font-size: var(--fs-sm); color: var(--text-secondary);
  padding: 6px 14px; background: var(--bg-secondary);
  border-radius: var(--radius-full); border: 1px solid var(--border-light);
}

/* --- Page Content --- */
.page-content { flex: 1; padding: var(--space-xl); }

/* --- Grids --- */
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-lg); }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-lg); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-lg); }
.grid-1-1 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); }

.section { margin-bottom: var(--space-xl); }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-lg);
}
.section-title { font-size: var(--fs-lg); font-weight: 700; color: var(--text-heading); }
.section-subtitle { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }
