/* ===================================================
   STYLE UTAMA DASHBOARD PENILAIAN
   Mode: Dark minimalis ungu neon
   =================================================== */

/* === Variabel Warna === */
:root {
  --bg: #121212;
  --card: #1e1e1e;
  --muted: #181818;
  --line: #2a2a2a;
  --text: #e5e5e5;
  --text-dim: #bdbdbd;
  --primary: #8b5cf6;
  --primary-2: #7c3aed;
  --danger: #f43f5e;
  --danger-2: #e11d48;
  --shadow: 0 0 20px rgba(139, 92, 246, 0.08);
}

/* === Reset dasar === */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* === Layout umum === */
.container {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.hidden { display: none !important; }

/* === Navbar === */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1b1b1b;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 600; }
.actions button {
  margin-left: 8px;
  padding: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.actions button:hover {
  border-radius: 2px;
  transform: scale(1.05);
}

/* === Tombol === */
button { cursor: pointer; border: none; font-family: inherit; }
.btn {
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  transition: 0.2s;
}
.btn:hover { background: var(--primary-2); }
.logout { background: var(--danger); }
.logout:hover { background: var(--danger-2); }
.btn-ghost {
  background: var(--muted);
  border: 1px solid var(--line);
  color: var(--text);
}
.btn-ghost:hover { background: #242424; }

/* === Input dan Select === */
input, select, textarea {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--muted);
  color: var(--text);
  outline: none;
  margin-bottom: 12px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

/* ===================================================
   TABLE CORE
   =================================================== */

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-top: 10px;
}

.rekap-viewer {
  border-collapse: collapse;
  width: 100%;
  min-width: 500px;        /* supaya tabel tidak terlalu besar */
  font-size: 14px;
  table-layout: fixed;     /* kunci agar width kolom benar-benar dipatuhi */
}

.rekap-viewer th,
.rekap-viewer td {
  border: 1px solid var(--line);
  padding: 10px;
  text-align: center;
  white-space: nowrap;
}

.rekap-viewer thead th {
  position: sticky;
  top: 0;
  background: var(--muted);
  z-index: 2;
}

/* No — kecil & sticky */
.rekap-viewer th:nth-child(1),
.rekap-viewer td:nth-child(1) {
  width: 50px;
  min-width: 50px;
  text-align: center;
  position: sticky;
  left: 0;
  background: #1a1a1a;
  z-index: 5;
}

/* Nama — kecil, autofit, ellipsis */
.rekap-viewer th:nth-child(2),
.rekap-viewer td:nth-child(2) {
  width: 160px;
  max-width: 160px;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left !important;
}

/* Progress — kecil */
.rekap-viewer th:nth-child(3),
.rekap-viewer td:nth-child(3) {
  width: 80px;
  text-align: center;
}

/* Narasi — paling lebar & wrap */
.rekap-viewer th:nth-child(4),
.rekap-viewer td:nth-child(4) {
  width: 250px;
  max-width: 350px;
  text-align: left;
  white-space: normal;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

/* Link — kecil */
.rekap-viewer th:nth-child(5),
.rekap-viewer td:nth-child(5) {
  width: 90px;
  text-align: center;
}

/* Vertical alignment */
.rekap-viewer td {
  vertical-align: top;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ===================================================
   NARASI WRAP + READ MORE
   =================================================== */

.narasi-cell {
  position: relative;
  max-height: 3.4em;    /* 2 baris */
  overflow: hidden;
  white-space: normal;
  line-height: 1.7em;
  transition: max-height 0.25s ease;
}

.narasi-cell.expanded {
  max-height: 1200px;
}

.narasi-toggle {
  color: #7dd3fc;
  cursor: pointer;
  font-size: 0.85em;
  margin-top: 4px;
  display: inline-block;
  user-select: none;
}

/* ===================================================
   FILTER GRID
   =================================================== */
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 10px;
}
@media (min-width: 900px) {
  .filter-grid {
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
  }
  .filter-grid label {
    margin-bottom: 6px;
    display: block;
  }
}

/* ===================================================
   ADMIN — MATERI CHECKLIST GRID
   =================================================== */
#materiList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 20px;
}

#materiList label {
  background: #181818;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #292929;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  transition: 0.2s;
}

#materiList label:hover {
  background: #232323;
  border-color: var(--primary);
}

#materiList input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ===================================================
   MULTI COLUMN LIST (Siswa / Materi)
   =================================================== */
#listMateri, #listSiswa {
  column-count: 1;
  column-gap: 24px;
}

@media (min-width: 768px) {
  #listMateri, #listSiswa {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  #listMateri, #listSiswa {
    column-count: 3;
  }
}

/* ===================================================
   LOGIN PANEL
   =================================================== */

body.login-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 40px 0;
}

body.login-page .login-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 48px 36px 40px;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.15);
  text-align: center;
  max-width: 380px;
  width: 90%;
}

body.login-page .login-panel h2 { margin-bottom: 20px; }

body.login-page .login-panel .btn {
  margin: 16px auto 10px;
  padding: 10px 28px;
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.25);
}
body.login-page .login-panel .btn:hover {
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

body.login-page .login-panel .footer {
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--text-dim);
  opacity: 0.9;
}


