/* css/layout.css — sidebar, topbar, main */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 100; overflow-y: auto;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08); flex-shrink: 0;
}
.brand-emblem {
  width: 36px; height: 36px; border-radius: 9px;
  background: linear-gradient(135deg, #3464B8, #3A9F96);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.brand-title { font-size: 14px; font-weight: 700; color: #fff; display: block; }
.brand-sub   { font-size: 10px; color: rgba(255,255,255,.45); display: block; }
.sidebar-nav { flex: 1; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.nav-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: .08em;
  color: rgba(255,255,255,.35); text-transform: uppercase;
  padding: 14px 10px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: rgba(255,255,255,.72);
  transition: background .15s, color .15s; width: 100%; text-align: left;
}
.nav-item:hover  { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.nav-icon {
  width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 10px; color: rgba(255,255,255,.45); }
.logout-btn {
  color: rgba(255,255,255,.45); flex-shrink: 0;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: color .15s;
}
.logout-btn:hover { color: #fff; background: rgba(255,255,255,.08); }

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

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 24px;
  position: sticky; top: 0; z-index: 90;
}
.topbar-left   { display: flex; align-items: center; min-width: 160px; }
.topbar-center { flex: 1; }
.topbar-right  { display: flex; align-items: center; gap: 12px; }
.breadcrumb    { font-size: 14px; font-weight: 600; color: var(--text); }

.search-trigger {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 14px; font-size: 13px; color: var(--text-muted);
  width: 100%; max-width: 360px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.search-trigger:hover { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-kbd {
  margin-left: auto; font-size: 11px; background: var(--border-light);
  border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; color: var(--text-light);
}

.topbar-icon-btn {
  position: relative; width: 36px; height: 36px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background .15s, color .15s;
}
.topbar-icon-btn:hover { background: var(--bg); color: var(--text); }
.notif-badge {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px;
  border-radius: 8px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; padding: 0 3px; border: 2px solid #fff;
}
.notif-wrap  { position: relative; }
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); z-index: 200; overflow: hidden;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light);
}
.notif-title { font-size: 13px; font-weight: 700; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px;
  cursor: pointer; border-bottom: 1px solid var(--border-light); transition: background .1s;
}
.notif-item:hover { background: var(--bg); }
.notif-item:last-child { border-bottom: none; }
.notif-unread { background: #F8FBFF; }
.notif-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; font-weight: 600;
}
.notif-body { flex: 1; min-width: 0; }
.notif-text { font-size: 12.5px; line-height: 1.4; }
.notif-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.topbar-user { display: flex; align-items: center; gap: 9px; padding-left: 12px; border-left: 1px solid var(--border); }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.topbar-name { font-size: 13px; font-weight: 600; }
.topbar-role { font-size: 11px; color: var(--text-muted); }

/* ── Page ── */
.main-content { flex: 1; padding: 28px; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}
.page-title    { font-size: 22px; font-weight: 700; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.page-actions  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
