/* layout.css
   Top bar, shell, stat strip and the bento grid.

   Part of the dashboard stylesheet, split by concern. index.html links these
   in source order; keep that order, the cascade depends on it. */

/* ── Top bar ────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 20;
  height: var(--nav-h); display: flex; align-items: center; gap: 12px;
  padding: 0 22px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border-2);
}
.nav-home-btn {
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 0; flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}
.nav-home-btn:hover { opacity: 0.82; transform: scale(1.06); }
.nav-home-btn:active { transform: scale(0.95); opacity: 0.65; }
.nav-brand-icon { width: 30px; height: 30px; border-radius: 8px; overflow: hidden; }
.nav-brand-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nav-badge {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 4px;
  background: var(--accent);   /* overridden inline with the school's primary color */
  box-shadow: 0 3px 10px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.22);
}
.nav-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.nav-badge span { font-family: Georgia, serif; font-weight: 700; font-size: 17px; color: #fff; }
.nav-titles { display: flex; flex-direction: column; line-height: 1.15; }
.nav-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.nav-subtitle { font-size: 11.5px; color: var(--label-2); }
.nav-spacer { flex: 1; }
.nav-user { position: relative; }
.nav-user-trigger {
  display: flex; align-items: center; gap: 9px; padding: 5px 7px;
  background: none; border: none; cursor: pointer; border-radius: var(--r-sm);
  color: inherit; transition: background 0.14s;
}
.nav-user-trigger:hover { background: var(--surface-2); }
.nav-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-light); color: var(--accent);
  font-size: 11.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.nav-user-name { font-size: 13px; font-weight: 550; }
.nav-user-role { font-size: 11px; color: var(--label-2); text-transform: capitalize; text-align: left; }
.nav-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 160px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: 4px; z-index: 200;
  animation: scaleIn 0.15s ease both; transform-origin: top right;
}
.nav-dropdown.hidden { display: none; }
.dropdown-item {
  display: block; width: 100%; text-align: left; padding: 9px 13px;
  font-size: 13.5px; background: none; border: none; cursor: pointer;
  color: var(--label); border-radius: var(--r-sm); transition: background 0.12s;
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item.danger { color: var(--red); }
.dropdown-item.danger:hover { background: var(--red-light); }

/* ── Shell / greeting ───────────────────────────────────────────────── */
.shell { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 26px 22px 60px; }
.greeting { margin-bottom: 20px; }
.greeting h1 { font-size: 25px; font-weight: 780; letter-spacing: -0.025em; }
.greeting p { font-size: 14px; color: var(--label-2); margin-top: 3px; }

/* Read-only notice under a greeting — shared by the full dashboard (.greeting),
   the picker workspaces (.ws-greet) and recruiting (.rc-greet). */
.ro-banner {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  font-size: 13px; color: var(--label-2);
}

/* ── Stat strip ─────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  padding: 14px 16px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 13px;
}
.stat-ic { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.stat-ic svg { width: 18px; height: 18px; }
.stat-val { font-size: 21px; font-weight: 750; letter-spacing: -0.02em; line-height: 1; }
.stat-lbl { font-size: 11.5px; color: var(--label-2); margin-top: 3px; font-weight: 500; }

/* ── Bento grid ─────────────────────────────────────────────────────── */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.card {
  grid-column: span 4;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  height: 295px; overflow: hidden;   /* fixed compact height — never resizes; Full … buttons reveal overflow */
}
.card.span-7 { grid-column: span 7; }
.card.span-5 { grid-column: span 5; }
/* Entrance animation plays ONCE, on first mount (body.booting). Data updates
   re-render in place and never replay it, so nothing flashes on date switch,
   calendar resync, or edits. */
body.booting .greeting { animation: fadeUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
body.booting .stats    { animation: fadeUp 0.4s cubic-bezier(0.16,1,0.3,1) 0.04s both; }
body.booting .card     { animation: fadeUp 0.42s cubic-bezier(0.16,1,0.3,1) both; }
.card.span-12 { grid-column: span 12; height: auto; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 16px 12px; border-bottom: 1px solid var(--border-2); flex-shrink: 0;
}
.card-ic { width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-ic svg { width: 15px; height: 15px; }
.card-title { font-size: 14.5px; font-weight: 680; letter-spacing: -0.01em; }
.card-meta { font-size: 12px; color: var(--label-2); font-weight: 500; }
.card-head-spacer { flex: 1; }
.card-body { padding: 8px 10px 12px; overflow-y: auto; flex: 1; }
.card-body::-webkit-scrollbar { width: 8px; }
.card-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }

.add-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--accent-light); color: var(--accent); border: none; cursor: pointer;
  transition: background 0.14s, transform 0.08s;
}
.add-btn:hover { background: var(--accent); color: #fff; }
.add-btn:active { transform: scale(0.92); }
.add-btn svg { width: 15px; height: 15px; }

.empty { text-align: center; color: var(--label-2); padding: 26px 16px; font-size: 13px; }
.empty-strong { font-weight: 600; color: var(--label); margin-bottom: 3px; }
