/* ── App shell ── */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: var(--s24) 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--s10);
  padding: 0 var(--s20) var(--s28);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--s16);
}
.logo-mark {
  width: 32px; height: 32px;
  background: var(--accent);
  color: #0c0e14;
  border-radius: var(--r8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
}
.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--text-primary);
}
.sidebar-nav {
  flex: 1;
  padding: 0 var(--s12);
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--s12);
  padding: var(--s10) var(--s12);
  border-radius: var(--r8);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--t-fast);
  position: relative;
}
.nav-item:hover { background: var(--bg-elevated); color: var(--text-primary); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--accent);
  color: #0c0e14;
  font-size: 10px;
  padding: 1px 6px;
  min-width: 18px;
  justify-content: center;
}
.nav-item .badge[data-count="0"] { display: none; }

.sidebar-bottom {
  padding: var(--s16) var(--s12) 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--s16);
  display: flex;
  flex-direction: column;
  gap: var(--s8);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--s10);
  padding: var(--s8) var(--s12);
  border-radius: var(--r8);
  cursor: pointer;
  transition: background var(--t-fast);
}
.sidebar-user:hover { background: var(--bg-elevated); }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #0c0e14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}
.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.logout-btn {
  display: flex;
  align-items: center;
  gap: var(--s8);
  padding: var(--s8) var(--s12);
  border-radius: var(--r8);
  font-size: 13px;
  color: var(--text-muted);
  width: 100%;
  text-align: left;
  transition: all var(--t-fast);
}
.logout-btn:hover { color: var(--red); background: var(--red-soft); }

/* ── Main content area ── */
#page-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  overflow-x: hidden;
}
#page-content.no-sidebar { margin-left: 0; }

.page-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--s32) var(--s32) var(--s64);
}
.page-inner-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s32) var(--s32) var(--s64);
}

/* ── Page header ── */
.page-header {
  margin-bottom: var(--s32);
}
.page-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: var(--s4);
}
.page-header p { color: var(--text-secondary); font-size: 15px; }

/* ── Two column ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--s24);
  align-items: start;
}
.two-col-equal { grid-template-columns: 1fr 1fr; }

/* ── Job grid ── */
.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s16);
}
.jobs-list { display: flex; flex-direction: column; gap: var(--s12); }

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s16);
  margin-bottom: var(--s32);
}

/* ── Mobile nav ── */
.mobile-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mob-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--s10) var(--s8);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color var(--t-fast);
  position: relative;
}
.mob-nav-item:hover, .mob-nav-item.active {
  color: var(--accent);
}
.mob-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 2px;
  background: var(--accent);
  border-radius: var(--r-full);
}

/* ── Toast container ── */
#toast-container {
  position: fixed;
  bottom: var(--s24);
  right: var(--s24);
  display: flex;
  flex-direction: column;
  gap: var(--s8);
  z-index: 9999;
}

/* ── Sticky sidebar panel ── */
.sticky-panel {
  position: sticky;
  top: var(--s32);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sidebar { display: none !important; }
  #page-content { margin-left: 0 !important; }
  .mobile-nav { display: flex !important; }
  .page-inner, .page-inner-wide {
    padding: var(--s20) var(--s16) 90px;
  }
  .two-col { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .jobs-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
