/* assets/style.css
   Bahasa desain SIKADU: gradient oranye->merah muda sebagai aksen,
   navy gelap untuk sisi "sistem", kartu putih untuk sisi "form/data".
   Dipakai bersama oleh index, login, dan seluruh dashboard admin/dosen/mahasiswa. */

:root {
  --accent-1: #1a9b62;
  --accent-2: #04593f;
  --accent-gold: #c9a24b;
  --ink: #06231a;
  --ink-2: #0c3d2c;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --border: #d1d5db;
  --border-soft: #e5e7eb;
  --surface: #ffffff;
  --surface-tint: #f9fafb;
  --danger-bg: #fee2e2;
  --danger-fg: #991b1b;
  --success-bg: #dcfce7;
  --success-fg: #166534;
  --warn-bg: #fef3c7;
  --warn-fg: #92400e;
  --radius: 12px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
}

.brand-bg {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background-image: url("uin-gusdur-01.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--ink);
}
/* Overlay gelap transparan di atas foto, supaya teks & kartu putih tetap
   kebaca dan nuansa hijau islami-nya tetap kerasa - bukan foto polos. */
.brand-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 1px, transparent 1px, transparent 26px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.035) 0px, rgba(255,255,255,.035) 1px, transparent 1px, transparent 26px),
    radial-gradient(circle at 10% 10%, rgba(26, 155, 98, .45), transparent 35%),
    radial-gradient(circle at 90% 90%, rgba(201, 162, 75, .22), transparent 35%),
    linear-gradient(135deg, rgba(6,35,26,.88), rgba(12,61,44,.88));
  z-index: 0;
}
.brand-bg > * { position: relative; z-index: 1; }

.gradient-text,
.logo,
.button-primary {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
}

.logo {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 800;
  flex-shrink: 0;
}
.logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ============ MESSAGE / ALERT ============ */

.message {
  display: none;
  padding: 13px 15px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
}
.message.error   { display: block; background: var(--danger-bg); color: var(--danger-fg); }
.message.success { display: block; background: var(--success-bg); color: var(--success-fg); }
.message.warn    { display: block; background: var(--warn-bg); color: var(--warn-fg); }

/* ============ FORM ELEMENTS ============ */

.form-group { margin-bottom: 18px; }

label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  transition: .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(26, 155, 98, .12);
}

.password-wrapper { position: relative; }
.password-wrapper input { padding-right: 90px; }
.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ============ BUTTONS ============ */

.button-primary {
  border: none;
  border-radius: var(--radius);
  color: white;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: .15s;
  padding: 13px 20px;
}
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(4, 89, 63, .30); }
.button-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; box-shadow: none; }

.button-secondary {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 11px 18px;
  transition: .15s;
}
.button-secondary:hover { background: var(--surface-tint); }

.button-danger {
  border: 1px solid #fecaca;
  background: var(--danger-bg);
  color: var(--danger-fg);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
}
.button-danger:hover { background: #fecaca; }

.button-ghost {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: 8px;
}
.button-ghost:hover { background: var(--surface-tint); color: var(--ink); }

.loading {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ APP SHELL (sidebar + content) ============ */

.app-shell {
  min-height: 100vh;
  display: flex;
  background: var(--surface-tint);
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--ink), var(--ink-2));
  color: white;
  display: flex;
  flex-direction: column;
  padding: 28px 20px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 24px;
}
.sidebar-brand .name { font-weight: 800; font-size: 17px; }
.sidebar-brand .role { font-size: 12px; color: rgba(255,255,255,.55); }

.sidebar-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.sidebar-nav a {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: 10px;
  transition: .15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,.06); color: white; }
.sidebar-nav a.active {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
}

.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 16px;
  margin-top: 16px;
}
.sidebar-user { font-size: 13px; color: rgba(255,255,255,.6); margin-bottom: 10px; word-break: break-word; }
.sidebar-logout { width: 100%; }

.main {
  flex: 1;
  min-width: 0;
  padding: 40px 56px 64px;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 24px; margin-bottom: 4px; }
.page-header p { color: var(--muted); font-size: 14px; }

/* ============ SIDEBAR AVATAR BLOCK (mirip referensi: avatar besar + nama) ============ */

.sidebar-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 8px 18px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-avatar-block .avatar { width: 64px; height: 64px; font-size: 22px; margin-bottom: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.25); }
.sidebar-avatar-block .name { color: white; font-weight: 700; font-size: 14px; word-break: break-word; }
.sidebar-avatar-block .role { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 2px; margin-bottom: 10px; }
.sidebar-avatar-block .underline { width: 36px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent-1), var(--accent-2)); }

/* ============ CALENDAR WIDGET ============ */

.calendar-widget {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.calendar-header {
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  padding: 16px 20px;
  text-align: center;
  font-weight: 800;
  letter-spacing: .04em;
  font-size: 14px;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  padding: 16px 14px;
}
.calendar-dow { font-size: 10.5px; color: var(--muted); text-align: center; font-weight: 700; padding-bottom: 6px; }
.calendar-day { text-align: center; font-size: 12.5px; padding: 7px 0; border-radius: 8px; color: var(--ink); }
.calendar-day.other-month { color: var(--muted-2); opacity: .4; }
.calendar-day.today { background: var(--accent-1); color: white; font-weight: 800; }

.dash-top-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  align-items: start;
  margin-bottom: 24px;
}
@media (max-width: 760px) {
  .dash-top-grid { grid-template-columns: 1fr; }
}



.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Tombol yang tampil seperti link teks - dipakai untuk nama yang bisa
   diklik (mis. nama mahasiswa di tabel peserta) tanpa perlu jadi <a href>. */
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-2);
  font-weight: 600;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.link-button:hover { opacity: .75; }

.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sidebar-user-row .avatar { width: 36px; height: 36px; font-size: 13px; }
.sidebar-user-row .sidebar-user { margin-bottom: 0; }
.sidebar-user-row .sidebar-user .name-line { color: white; font-weight: 700; font-size: 13px; }
.sidebar-user-row .sidebar-user .role-line { font-size: 11px; }

/* ============ ELEGANT ICON STAT CARDS ============ */

.stat-grid-elegant {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card-elegant {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: .15s;
}
.stat-card-elegant:hover { box-shadow: 0 8px 24px rgba(0,0,0,.06); transform: translateY(-1px); }
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-card-elegant .stat-text .label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat-card-elegant .stat-text .value { font-size: 24px; font-weight: 800; color: var(--ink); }

/* Palet ikon - variasi warna untuk keterbacaan data, tetap dalam nuansa
   hijau-emas islami sebagai basis, dengan aksen teal/biru untuk variasi. */
.stat-icon.c1 { background: #dcfce7; color: #04593f; }
.stat-icon.c2 { background: #fef3c7; color: #92400e; }
.stat-icon.c3 { background: #dbeafe; color: #1e40af; }
.stat-icon.c4 { background: #e0e7ff; color: #3730a3; }
.stat-icon.c5 { background: #ccfbf1; color: #0f766e; }
.stat-icon.c6 { background: #fce7f3; color: #9d174d; }

/* ============ PROFILE CARD ============ */

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.profile-card .avatar { width: 72px; height: 72px; font-size: 24px; }
.profile-card .profile-info { flex: 1; min-width: 180px; }
.profile-card .profile-info h2 { font-size: 19px; margin-bottom: 2px; }
.profile-card .profile-info .sub { color: var(--muted); font-size: 13.5px; }
.profile-card .profile-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.profile-card .profile-meta .meta-item { font-size: 13px; }
.profile-card .profile-meta .meta-item .k { color: var(--muted); display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.social-links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.social-links a {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; text-decoration: none;
  color: var(--ink); background: var(--surface-tint);
  border: 1px solid var(--border-soft); border-radius: 999px;
  padding: 5px 12px;
}
.social-links a:hover { background: var(--border-soft); }

.info-card-highlight {
  background: linear-gradient(135deg, rgba(26,155,98,.08), rgba(201,162,75,.06));
  border: 1px solid rgba(26,155,98,.18);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.info-card-highlight .stat-icon { background: white; }
.info-card-highlight .title { font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.info-card-highlight .value { font-size: 17px; font-weight: 700; color: var(--ink); }

.class-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
}

/* Baris navigasi yang ringkas - dipakai untuk daftar pertemuan dsb, biar
   hemat tempat di HP (bukan kartu besar dengan tombol penuh). */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: inherit;
}
.list-row .list-row-title { font-weight: 700; font-size: 13.5px; }
.list-row .list-row-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-row .list-row-chevron { font-size: 18px; color: var(--muted); flex-shrink: 0; }
.list-row.active { border-color: var(--accent-1); background: var(--surface-tint); }
@media (max-width: 480px) {
  .list-row { padding: 10px 12px; }
  .list-row .list-row-title { font-size: 13px; }
}
.class-card .title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.class-card .meta { font-size: 13px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }

.materi-content h1, .materi-content h2, .materi-content h3 { margin: 14px 0 6px; font-weight: 700; }
.materi-content p { margin-bottom: 10px; }
.materi-content ul, .materi-content ol { margin: 0 0 10px 22px; }
.materi-content a { color: var(--accent-2); font-weight: 600; }
.materi-content blockquote { border-left: 3px solid var(--accent-1); padding-left: 12px; color: var(--muted); margin: 10px 0; }
.materi-content pre { background: var(--surface-tint); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 13px; }
.materi-content img { max-width: 100%; border-radius: 8px; }



.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 20px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .label { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.stat-card .value { font-size: 30px; font-weight: 800; }

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

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.table-toolbar input[type="search"] { max-width: 280px; }

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.data-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-tint); }

.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.badge.active   { background: var(--success-bg); color: var(--success-fg); }
.badge.inactive { background: #f3f4f6; color: var(--muted); }

/* Countdown deadline tugas - warna berubah sesuai seberapa dekat deadline-nya. */
.countdown-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 6px;
}
.countdown-badge.countdown-safe    { background: var(--success-bg); color: var(--success-fg); }
.countdown-badge.countdown-warning { background: #fff4d6; color: #9a6b00; }
.countdown-badge.countdown-urgent  { background: #fde0e0; color: #b91c1c; animation: countdownPulse 1.4s ease-in-out infinite; }
.countdown-badge.countdown-over    { background: #f3f4f6; color: var(--muted); }
@keyframes countdownPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  font-size: 14px;
}

/* Panel yang scroll ke bawah kalau isinya panjang, supaya halaman tidak
   memanjang tak terbatas - dipakai untuk daftar/tabel yang bisa berisi
   banyak baris (peserta kelas, materi, tugas, pertemuan, dst). */
.scroll-panel {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: auto;
  border-radius: 10px;
}
@media (max-width: 760px) {
  .scroll-panel { max-height: 50vh; }
}

/* ============ MODAL ============ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .55);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  padding: 32px;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-header h2 { font-size: 19px; }
.modal-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  color: var(--muted);
  line-height: 1;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
}
.form-grid-2 .span-2 { grid-column: 1 / -1; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

/* ============ RESPONSIVE ============ */

/* ============ HAMBURGER MENU (mobile) ============ */

.hamburger-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 70;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  border: none;
  background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  color: white;
  font-size: 20px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(4,89,63,.35);
  cursor: pointer;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6,35,26,.55);
  z-index: 55;
}
.sidebar-backdrop.open { display: block; }

@media (max-width: 860px) {
  .hamburger-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 82vw;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 60;
    overflow-y: auto;
    padding: 24px 18px;
  }
  .sidebar.open { transform: translateX(0); }

  .app-shell { flex-direction: row; }
  .main { padding: 88px 20px 48px; }

  .page-header { margin-bottom: 24px; }
  .card { padding: 22px 20px; margin-bottom: 18px; }
  .stat-grid { gap: 12px; }
  .modal-backdrop { padding: 24px 14px; }
  .modal { padding: 26px 22px; }
  .form-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .main { padding: 80px 16px 40px; }
  .card { padding: 20px 16px; }
  .stat-card { padding: 16px; }
  .page-header h1 { font-size: 21px; }
}
