/* =====================================================================
   Back Office — gaya tambahan (melengkapi styles.css + dashboard.css)
   ===================================================================== */

/* atribut hidden harus mengalahkan display:grid */
#adminGate[hidden], #adminApp[hidden] { display: none !important; }

/* ---- login gate ---- */
.admin-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, var(--indigo-50), transparent 60%), var(--bg-alt); }
.admin-gate-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 40px; box-shadow: var(--shadow-lg); }
.admin-gate-card .brand { margin-bottom: 16px; }
.admin-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .16em; color: #fff; background: var(--grad); padding: 4px 12px; border-radius: 999px; margin-bottom: 14px; }
.admin-gate-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.admin-gate-card .auth-sub { color: var(--muted); margin: 6px 0 24px; }
.admin-gate-card #adminLoginForm { display: grid; gap: 16px; }

/* ---- tag admin di sidebar ---- */
.admin-tag { display: inline-block; margin: -6px 8px 8px; font-size: 10px; font-weight: 800; letter-spacing: .18em; color: #a5b4fc; }

/* ---- kartu tabel tanpa padding ---- */
.card.no-pad { padding: 0; overflow: hidden; }
.card.no-pad .tx { width: 100%; }
.card.no-pad .tx th { background: var(--bg-alt); }
.card.no-pad .tx th, .card.no-pad .tx td { padding: 14px 18px; }
.card.no-pad .tx tbody tr:hover { background: var(--bg-alt); }
.tag-info { background: #dbeafe; color: #2563eb; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.tag-warn { background: #fef3c7; color: #b45309; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.row-act { text-align: right; }
.mini-btn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: 14px; transition: .2s; }
.mini-btn:hover { background: #fee2e2; border-color: #fecaca; }

/* ---- chart batang ---- */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar-fill { width: 100%; max-width: 46px; background: var(--grad); border-radius: 8px 8px 0 0; min-height: 6px; transition: height .6s cubic-bezier(.22,1,.36,1); }
.bar-val { font-size: 12px; font-weight: 700; color: var(--slate); }
.bar-m { font-size: 12px; color: var(--muted); }

/* ---- ranking kelas terlaris ---- */
.rank { display: grid; gap: 12px; }
.rank li { display: flex; align-items: center; gap: 12px; }
.rank-no { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; background: var(--indigo-50); color: var(--indigo-600); font-weight: 800; font-size: 13px; }
.rank-name { flex: 1; font-size: 14px; font-weight: 600; }
.rank-val { font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* ---- moderasi ---- */
#modList { display: grid; gap: 4px; }
.mod-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mod-item:last-child { border-bottom: 0; }
.mod-body { flex: 1; min-width: 0; }
.mod-body p { font-size: 14.5px; color: var(--slate); margin-top: 2px; word-wrap: break-word; }
.empty { color: var(--muted); font-size: 14.5px; text-align: center; padding: 30px 10px; }

/* ---- modal ---- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(15,23,42,.5); display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 440px; background: #fff; border-radius: 18px; padding: 26px; box-shadow: var(--shadow-lg); animation: fadein .25s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h3 { font-size: 20px; }
.modal-x { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--muted); }
#classForm { display: grid; gap: 14px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---- modal hak akses ---- */
.access-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.access-list { display: grid; gap: 8px; margin-bottom: 8px; max-height: 320px; overflow-y: auto; }
.access-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s, background .2s; }
.access-item:hover { background: var(--bg-alt); }
.access-item:has(input:checked) { border-color: var(--indigo); background: var(--indigo-50); }
.access-item input { width: 18px; height: 18px; accent-color: var(--indigo); flex-shrink: 0; }
.ai-thumb { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--ink); flex-shrink: 0; }
.ai-name { font-size: 14.5px; font-weight: 600; }

/* ---- panel video kursus ---- */
.vid-course-select { font-family: inherit; font-weight: 600; font-size: 14px; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 9px 16px; background: #fff; }
.vid-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.vid-row:last-child { border-bottom: 0; }
.vid-yt { font-family: ui-monospace, monospace; font-size: 12px; background: var(--bg-alt); border: 1px solid var(--line); padding: 4px 8px; border-radius: 8px; white-space: nowrap; }
.vid-meta { flex: 1; min-width: 0; }
.vid-meta b { font-size: 14px; display: block; }
.vid-meta small { color: var(--muted); font-size: 12.5px; }
.vid-meta em { font-style: normal; font-weight: 800; color: var(--green); }

@media (max-width: 640px) {
  .admin-gate-card { padding: 28px; }
  .chart { gap: 8px; }
  .card.no-pad { overflow-x: auto; }
}
