/* ============================================================
   Nirvana Secondary School — Admin portal styling
   ============================================================ */
:root {
  --blue-900: #0a2a66;
  --blue-800: #0b3d91;
  --blue-700: #1356c4;
  --blue-600: #1769e0;
  --blue-100: #e8f1ff;
  --blue-50:  #f3f8ff;
  --ink: #16213a;
  --muted: #5a6680;
  --line: #e2e8f4;
  --danger: #e23b3b;
  --ok: #1c8a4a;
  --radius: 16px;
  --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--blue-50); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }

/* ---------- Buttons / fields (shared) ---------- */
.btn { display: inline-block; font-weight: 700; padding: .75rem 1.5rem; border-radius: 10px; cursor: pointer; border: 2px solid transparent; font-size: .95rem; transition: background .2s, transform .15s; font-family: inherit; }
.btn-primary { background: var(--blue-700); color: #fff; }
.btn-primary:hover { background: var(--blue-800); }
.btn-primary:disabled { opacity: .6; cursor: default; }
.btn-text { background: none; color: var(--muted); }
.btn-text:hover { color: var(--ink); }
.btn.full { width: 100%; text-align: center; }
.link-btn { background: none; border: 0; color: var(--blue-700); font-weight: 600; cursor: pointer; font-size: .9rem; padding: .4rem; width: 100%; font-family: inherit; }
.link-btn:hover { text-decoration: underline; }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: .35rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-size: .95rem; background: #fff; transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--blue-500, #2e86f6); box-shadow: 0 0 0 3px rgba(46,134,246,.18);
}
.field.check label { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.field.check input { width: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ============ AUTH PAGE ============ */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(160deg, var(--blue-800), var(--blue-900));
}
.auth-card { width: min(100%, 420px); background: #fff; border-radius: 22px; padding: 2.4rem; box-shadow: 0 30px 60px -25px rgba(0,0,0,.55); position: relative; }
.auth-back { position: absolute; top: 1.1rem; left: 1.4rem; font-size: .82rem; color: var(--muted); }
.auth-back:hover { color: var(--blue-700); }
.auth-brand { text-align: center; margin-bottom: 1.8rem; }
.auth-brand img { width: 72px; margin: .6rem auto 1rem; border-radius: 12px; }
.auth-brand h1 { font-size: 1.4rem; color: var(--blue-800); }
.auth-brand p { color: var(--muted); font-size: .9rem; }
.auth-form .field input { background: var(--blue-50); }
.auth-hint { color: var(--muted); font-size: .9rem; margin-bottom: 1rem; text-align: center; }
.auth-msg { margin-top: .9rem; text-align: center; font-weight: 600; font-size: .9rem; min-height: 1.2em; }
.auth-msg.err { color: var(--danger); }
.auth-msg.ok { color: var(--ok); }

/* ============ DASHBOARD ============ */
.dash-body { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

.sidebar { background: var(--blue-900); color: #cdd9f2; display: flex; flex-direction: column; padding: 1.2rem .9rem; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: .6rem; padding: .4rem .5rem 1.2rem; font-weight: 800; color: #fff; font-size: 1.15rem; }
.sidebar-brand img { width: 38px; border-radius: 8px; }
.sidebar-brand small { display: block; font-size: .65rem; letter-spacing: 2px; text-transform: uppercase; color: #8fa8d8; font-weight: 600; }
.sidebar-nav { display: grid; gap: .25rem; margin-top: .5rem; }
.nav-item { display: block; width: 100%; text-align: left; background: none; border: 0; color: #cdd9f2; font-family: inherit; font-size: .92rem; font-weight: 600; padding: .75rem .8rem; border-radius: 10px; cursor: pointer; transition: background .18s, color .18s; }
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active { background: var(--blue-700); color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: .25rem; padding-top: 1rem; border-top: 1px solid rgba(255,255,255,.12); }
.nav-item.ghost { color: #9fb6e6; }

.dash-main { padding: 1.6rem 2rem 3rem; min-width: 0; }
.dash-top { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.6rem; }
.dash-top h1 { font-size: 1.5rem; color: var(--blue-800); flex: 1; }
.who { font-size: .88rem; color: var(--muted); background: #fff; padding: .5rem .9rem; border-radius: 999px; border: 1px solid var(--line); }
.hamburger { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; }
.hamburger span { width: 24px; height: 3px; background: var(--blue-800); border-radius: 3px; }

.panel { display: none; }
.panel.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: 1.8rem; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; display: flex; align-items: center; gap: 1rem; box-shadow: 0 18px 40px -28px rgba(11,61,145,.4); }
.stat-ico { font-size: 1.8rem; width: 54px; height: 54px; display: grid; place-items: center; background: var(--blue-100); border-radius: 14px; }
.stat-num { font-size: 1.9rem; font-weight: 800; color: var(--blue-800); line-height: 1; }
.stat-label { font-size: .82rem; color: var(--muted); margin-top: .25rem; }

/* Recent activity */
.activity-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.activity-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; }
.activity-col h3 { font-size: 1rem; color: var(--blue-800); margin-bottom: .8rem; }
.activity-list { list-style: none; display: grid; gap: .55rem; }
.activity-list li { display: flex; justify-content: space-between; gap: .8rem; font-size: .9rem; padding-bottom: .55rem; border-bottom: 1px dashed var(--line); }
.activity-list li:last-child { border-bottom: 0; }
.activity-list li span { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-list time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.activity-list li.empty { color: var(--muted); justify-content: flex-start; }

/* Editor */
.editor { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; margin-bottom: 1.8rem; box-shadow: 0 18px 40px -30px rgba(11,61,145,.4); }
.editor-title { font-size: 1.15rem; color: var(--blue-800); margin-bottom: 1.1rem; }
.editor-actions { display: flex; gap: .6rem; align-items: center; }
.editor-msg { margin-top: .8rem; font-weight: 600; font-size: .9rem; }
.editor-msg.ok { color: var(--ok); }
.editor-msg.err { color: var(--danger); }

/* Record list */
.record-list { display: grid; gap: 1rem; }
.record { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.record-main { min-width: 0; }
.record-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.record h4 { color: var(--blue-800); font-size: 1.08rem; margin-bottom: .25rem; }
.record p { color: var(--muted); font-size: .92rem; white-space: pre-wrap; }
.record p.muted { color: var(--blue-600); font-weight: 600; }
.record-date { font-size: .78rem; color: var(--muted); }
.chip { font-size: .72rem; font-weight: 700; text-transform: capitalize; color: var(--blue-700); background: var(--blue-100); padding: .22rem .6rem; border-radius: 999px; }
.chip.live { color: #fff; background: var(--ok); }
.chip.draft { color: #fff; background: #9aa6bd; }
.record-actions { display: flex; flex-direction: column; gap: .4rem; flex-shrink: 0; }
.icon-btn { background: var(--blue-50); border: 1px solid var(--line); color: var(--blue-700); font-weight: 600; font-size: .82rem; padding: .4rem .8rem; border-radius: 8px; cursor: pointer; font-family: inherit; }
.icon-btn:hover { background: var(--blue-100); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { background: #fde7e7; }
.empty { color: var(--muted); padding: 1rem; text-align: center; }
.empty.err { color: var(--danger); }

/* Gallery admin */
.gallery-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.2rem; }
.g-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; position: relative; }
.g-card img { width: 100%; height: 160px; object-fit: cover; }
.g-card figcaption { padding: .8rem; display: grid; gap: .35rem; }
.g-card figcaption strong { color: var(--blue-800); font-size: .95rem; }
.g-card figcaption p { color: var(--muted); font-size: .82rem; }
.g-del { position: absolute; top: .6rem; right: .6rem; background: rgba(255,255,255,.92); }

/* ---------- Pending-approval screen ---------- */
.pending-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 1.5rem;
  background: linear-gradient(160deg, var(--blue-800), var(--blue-900));
}
.pending-card {
  background: #fff; border-radius: var(--radius); padding: 2.4rem 2rem;
  max-width: 460px; width: 100%; text-align: center; display: grid; gap: .9rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.pending-card img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; border-radius: 12px; }
.pending-card h1 { font-size: 1.5rem; color: var(--blue-800); }
.pending-card p { color: var(--ink); font-size: .95rem; line-height: 1.5; }
.pending-card .muted { color: var(--muted); font-size: .85rem; }
.pending-card .btn { justify-self: center; margin-top: .4rem; }

.muted { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .activity-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dash-body { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; width: 250px; transform: translateX(-100%); transition: transform .3s; }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .hamburger { display: flex; }
  .dash-main { padding: 1.2rem; }
  .row { grid-template-columns: 1fr; }
}
