/*
 * File Styling Utama (style.css)
 *
 * Menggunakan variabel CSS untuk konsistensi,
 * Flexbox/Grid untuk layout responsif.
 */

/* Variabel Warna Global */
:root {
  --primary-color: #005a9c; /* Biru tua (akademik) */
  --secondary-color: #f8f9fa; /* Abu-abu muda (latar) */
  --text-color: #333;
  --white-color: #ffffff;
  --danger-color: #dc3545; /* Merah untuk error */
  --success-color: #28a745;
  --border-color: #dee2e6;
}

/* Reset Dasar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

body {
  background-color: var(--secondary-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* ------------------------------------- */
/* Halaman Login */
/* ------------------------------------- */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
}

.login-header {
  background-color: var(--primary-color);
  color: var(--white-color);
  padding: 20px;
  text-align: center;
}

.login-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.login-header i {
  margin-right: 10px;
}

.login-body {
  padding: 30px;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-control,
select.form-control,
textarea.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  transition: border-color 0.2s;
  background-color: var(--white-color);
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* Pastikan input[type="time"] tidak terlalu sempit */
input[type="time"].form-control {
  min-width: 150px;
  width: auto;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.1);
}

.btn-primary {
  padding: 12px 15px;
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--white-color);
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}

/* Mengembalikan tombol login agar full-width */
.login-body .btn-primary {
  width: 100%;
}

.btn-primary:hover {
  background-color: #004a80;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
}

.login-footer a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.9rem;
}

.login-footer a:hover {
  text-decoration: underline;
}

/* Pesan Error Login */
.error-message {
  background-color: #fff3f3;
  color: var(--danger-color);
  border: 1px solid #ffd6d6;
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 0.9rem;
}

/* ------------------------------------- */
/* Layout Dashboard */
/* ------------------------------------- */

.dashboard-wrapper {
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background-color: var(--primary-color);
  color: var(--white-color);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  transition: width 0.3s ease;
}

.sidebar-header {
  padding: 20px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header i {
  margin-right: 10px;
}

.sidebar-nav {
  list-style-type: none;
  margin-top: 20px;
}

.sidebar-nav li {
  position: relative;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: var(--white-color);
  text-decoration: none;
  transition: background-color 0.2s;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-nav a i {
  width: 20px;
  margin-right: 15px;
  text-align: center;
}

.main-content {
  display: flex;
  flex-direction: column;
}

.topbar {
  background-color: var(--white-color);
  padding: 15px 30px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.user-info a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 600;
}

.user-info i {
  margin-left: 10px;
  color: var(--danger-color);
}

.page-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.content-header {
  margin-bottom: 20px;
}

.card {
  background-color: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

/* ------------------------------------- */
/* LOGIKA MOBILE (Sembunyi/Geser) */
/* ------------------------------------- */
@media (max-width: 768px) {
  /* 1. Sidebar disembunyikan di kiri layar 
      Gunakan 'fixed' agar selalu di atas
    */
  .sidebar {
    position: fixed;
    left: -250px; /* Sembunyi di luar layar */
    top: 0;
    bottom: 0;
    height: 100vh; /* Penuh tinggi layar */
    z-index: 1000; /* Di atas konten */
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  }

  /* 2. Saat di-toggle, geser sidebar ke dalam layar 
    */
  .dashboard-wrapper.sidebar-toggled .sidebar {
    left: 0;
  }

  /* 3. Konten utama selalu 100% lebar
      (Kita tidak perlu margin-left di mobile)
    */
  .main-content {
    width: 100%;
    margin-left: 0; /* Hapus margin desktop */
  }

  /* 4. (Opsional) Tambahkan overlay gelap di belakang sidebar
      Ini perlu ditambahkan di header.php jika mau
    */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none; /* Sembunyi by default */
  }

  .dashboard-wrapper.sidebar-toggled .sidebar-overlay {
    display: block; /* Tampil saat sidebar dibuka */
  }

  /* 5. Kita tidak lagi butuh flex-direction: column
      Jadi hapus style .dashboard-wrapper { flex-direction: column; }
    */
}

/* ------------------------------------- */
/* Halaman Profil */
/* ------------------------------------- */
.profile-card ul {
  list-style-type: none; /* Hilangkan bullet points */
  padding: 0;
  margin-top: 15px;
}

.profile-card li {
  display: flex; /* Buat label dan data sejajar */
  flex-wrap: wrap; /* Bungkus jika layar terlalu kecil */
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 1rem;
}

.profile-card li:last-child {
  border-bottom: none; /* Hapus border di item terakhir */
}

.profile-card li strong {
  width: 200px; /* Lebar label yang konsisten */
  color: #555; /* Warna label sedikit redup */
}

.profile-card li span {
  flex: 1; /* Data akan mengisi sisa ruang */
  min-width: 200px; /* Pastikan data tidak terlalu sempit di layar kecil */
  word-break: break-all; /* Cegah email/teks panjang merusak layout */
}

/* Penyesuaian untuk mobile */
@media (max-width: 576px) {
  .profile-card li strong {
    width: 100%; /* Buat label mengambil satu baris penuh */
    margin-bottom: 5px;
    color: var(--text-color);
  }
}

/* ------------------------------------- */
/* Pesan Sukses */
/* ------------------------------------- */
.success-message {
  background-color: #f0fff4; /* Hijau sangat muda */
  color: var(--success-color); /* Variabel hijau dari root */
  border: 1px solid #c6f6d5; /* Border hijau muda */
  padding: 15px;
  border-radius: 5px;
  text-align: center;
  font-size: 0.9rem;
}

/* ------------------------------------- */
/* Tabel Jadwal Kuliah */
/* ------------------------------------- */

.schedule-table-container {
  width: 100%;
  overflow-x: auto; /* Memastikan bisa scroll horizontal jika terlalu lebar */
  margin-top: 20px;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.schedule-table th,
.schedule-table td {
  border: 1px solid var(--border-color);
  padding: 12px 15px;
  text-align: left;
}

.schedule-table thead {
  background-color: var(--secondary-color);
}

.schedule-table th {
  font-weight: 600;
  color: var(--primary-color);
}

.schedule-table tbody tr:nth-child(even) {
  background-color: #fcfcfc;
}

.schedule-table tbody tr:hover {
  background-color: var(--secondary-color);
}

/* Membuat tabel responsif */
@media (max-width: 768px) {
  .schedule-table thead {
    /* Sembunyikan header tabel di mobile */
    display: none;
  }

  .schedule-table tr {
    display: block; /* Ubah baris menjadi 'kartu' */
    border: 1px solid var(--border-color);
    margin-bottom: 15px;
  }

  .schedule-table td {
    display: flex;
    justify-content: space-between; /* Buat label dan data sejajar */
    text-align: right;
    border: none;
    border-bottom: 1px dotted var(--border-color);
    padding: 10px;
  }

  .schedule-table td:last-child {
    border-bottom: none;
  }

  .schedule-table td::before {
    /* Gunakan atribut data-label sebagai label */
    content: attr(data-label);
    font-weight: 600;
    text-align: left;
    padding-right: 15px;
    color: var(--primary-color);
  }
}

/* ------------------------------------- */
/* Halaman KHS (Ringkasan IPK) */
/* ------------------------------------- */
.khs-summary {
  display: flex;
  justify-content: space-around; /* Sejajarkan di desktop */
  flex-wrap: wrap; /* Bungkus di mobile */
  gap: 20px; /* Jarak antar item */
}

.khs-summary > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px 20px;
  background-color: var(--secondary-color);
  border-radius: 8px;
  flex: 1; /* Biarkan item tumbuh sama rata */
  min-width: 200px; /* Lebar minimum sebelum terbungkus */
}

.khs-summary span {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 8px;
}

.khs-summary strong {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* ------------------------------------- */
/* Halaman Keuangan */
/* ------------------------------------- */

/* Kotak ringkasan total tagihan */
.finance-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background-color: var(--secondary-color);
  border-radius: 8px;
  border-left: 5px solid var(--danger-color); /* Beri tanda merah */
}

.finance-summary span {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 10px;
}

.finance-summary strong {
  font-size: 2rem;
  font-weight: 700;
  color: var(--danger-color); /* Warna merah untuk tagihan */
}

/* Badge untuk status pembayaran */
.status-badge {
  color: var(--white-color);
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.status-lunas {
  background-color: var(--success-color); /* Hijau */
}

.status-badge.status-belum-bayar {
  background-color: var(--danger-color); /* Merah */
}

.status-badge.status-menunggu-verifikasi {
  background-color: #ffc107; /* Kuning */
  color: var(--text-color);
}

/* ------------------------------------- */
/* Halaman Pengisian KRS */
/* ------------------------------------- */

/* Ringkasan SKS mirip KHS tapi lebih simpel */
.krs-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  background-color: var(--secondary-color);
  border-radius: 8px;
}

.krs-summary span {
  font-size: 1rem;
  color: #555;
  margin-bottom: 8px;
}

.krs-summary strong {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Tombol Aksi di dalam tabel */
.btn-action {
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%; /* Buat tombol memenuhi sel di mobile */
}

.btn-action i {
  margin-right: 5px;
}

.btn-add {
  background-color: var(--success-color); /* Hijau */
}
.btn-add:hover {
  background-color: #218838;
}

.btn-drop {
  background-color: var(--danger-color); /* Merah */
}
.btn-drop:hover {
  background-color: #c82333;
}

.btn-drop:disabled {
  background-color: #aaa;
  cursor: not-allowed;
}

/* Badge status 'menunggu' (kita sudah punya lunas/belum-bayar) */
.status-badge.status-menunggu {
  background-color: #ffc107; /* Kuning */
  color: var(--text-color);
}

/* Penyesuaian tabel responsif untuk tombol */
@media (max-width: 768px) {
  .schedule-table td[data-label="Aksi"] {
    padding-top: 15px;
    padding-bottom: 15px;
  }
}

/* ------------------------------------- */
/* Sidebar Toggle & Hamburger */
/* ------------------------------------- */

/* Tombol Hamburger */
.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 0 10px;
}
.hamburger-btn:hover {
  color: var(--primary-color);
}

/* Transisi Halus */
.sidebar {
  /* Perbarui .sidebar (cari di atas) atau tambahkan ini:
      Transisi untuk 'width' (desktop) dan 'left' (mobile)
    */
  transition: width 0.3s ease, left 0.3s ease;
}

.main-content {
  /* Perbarui .main-content (cari di atas) atau tambahkan ini:
      Transisi untuk 'margin-left' (desktop)
    */
  transition: margin-left 0.3s ease;
}

/* ------------------------------------- */
/* LOGIKA DESKTOP (Menciut) */
/* (Media query ini agar tidak berlaku di mobile) */
/* ------------------------------------- */
@media (min-width: 769px) {
  /* Saat diciutkan, sidebar jadi kecil */
  .dashboard-wrapper.sidebar-toggled .sidebar {
    width: 80px; /* Lebar baru (hanya ikon) */
  }

  /* Sembunyikan teks di header sidebar */
  .dashboard-wrapper.sidebar-toggled .sidebar-header span {
    display: none;
  }

  /* Sembunyikan teks di menu navigasi */
  .dashboard-wrapper.sidebar-toggled .sidebar-nav span {
    display: none;
  }

  /* Pusatkan ikon saat sidebar ciut */
  .dashboard-wrapper.sidebar-toggled .sidebar-nav a {
    justify-content: center;
  }

  .dashboard-wrapper.sidebar-toggled .sidebar-nav a i {
    margin-right: 0;
    font-size: 1.1rem;
  }

  /* Geser konten utama agar sesuai 
      (Kita tidak lagi pakai flex, jadi margin-left penting)
    */
  .main-content {
    margin-left: 250px;
  }

  .dashboard-wrapper.sidebar-toggled .main-content {
    margin-left: 80px;
  }
}

/* ------------------------------------- */
/* Halaman Admin - Kelola (CRUD) */
/* ------------------------------------- */

/* Tombol sekunder (Batal) */
.btn-secondary {
  display: inline-block;
  padding: 12px 15px;
  background-color: #6c757d; /* Abu-abu */
  color: var(--white-color);
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
  text-decoration: none;
}
.btn-secondary:hover {
  background-color: #5a6268;
}

/* Penampung tombol aksi di tabel */
.action-buttons {
  display: flex;
  gap: 8px; /* Jarak antar tombol */
  align-items: center;
}

/* Styling ulang .btn-action agar lebih kecil */
.btn-action {
  padding: 6px 10px; /* Lebih kecil */
  font-size: 0.8rem;
  width: auto; /* Jangan 100% */
}

/* Tombol Edit (Baru) */
.btn-edit {
  background-color: #ffc107; /* Kuning */
  color: var(--text-color);
  text-decoration: none;
  display: inline-block;
}
.btn-edit:hover {
  background-color: #e0a800;
}

/* Pastikan form di dalam tabel tidak merusak layout */
.action-buttons form {
  margin: 0;
}

/* Responsif untuk .action-buttons */
@media (max-width: 768px) {
  .schedule-table td[data-label="Aksi"] {
    /* Pastikan tombol tidak terlalu besar di mobile */
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

/* ------------------------------------- */
/* Dashboard Admin - Kartu Statistik */
/* ------------------------------------- */

.stat-deck {
  display: grid;
  /* Buat 4 kolom di desktop, 2 di tablet, 1 di mobile */
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.stat-card {
  display: flex;
  align-items: center;
  background-color: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 20px;
  overflow: hidden; /* Jaga-jaga jika ikon terlalu besar */
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--white-color);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin-right: 15px;
  flex-shrink: 0; /* Cegah ikon menyusut */
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-info span {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 5px;
}

.stat-info strong {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-color);
}

/* ------------------------------------- */
/* Dashboard Mahasiswa - Grid & Jadwal */
/* ------------------------------------- */

.dashboard-grid {
  display: grid;
  /* 2 kolom (60% / 40%) di desktop */
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.welcome-card {
  /* Sudah di-cover .card */
}

.today-schedule-card {
  /* Sudah di-cover .card */
}

.today-schedule-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
  margin-top: 15px;
}

.today-schedule-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.today-schedule-list li:last-child {
  border-bottom: none;
}

.schedule-item-none {
  text-align: center;
  padding: 30px 10px;
  color: #777;
}

.schedule-item-none i {
  font-size: 2.5rem;
  margin-bottom: 15px;
  color: #ccc;
}

.schedule-time {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.schedule-title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.schedule-room {
  display: block;
  font-size: 0.9rem;
  color: #555;
}
.schedule-room i {
  margin-right: 5px;
  color: var(--danger-color);
}

.view-full-schedule {
  display: block;
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
}
.view-full-schedule:hover {
  text-decoration: underline;
}

/* ------------------------------------- */
/* Responsif untuk Dashboard */
/* ------------------------------------- */
@media (max-width: 992px) {
  /* Buat 2 kolom di tablet */
  .stat-deck {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Tumpuk layout dashboard mhs di tablet */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  /* Buat 1 kolom di mobile */
  .stat-deck {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------- */
/* Halaman Dosen - Form Input Nilai */
/* ------------------------------------- */

.schedule-table td .form-control {
  padding: 8px; /* Buat lebih kecil agar muat di tabel */
  font-size: 0.9rem;
  min-width: 100px;
}

/* ------------------------------------- */
/* Dashboard Mahasiswa - Kartu Statistik */
/* ------------------------------------- */

.student-stat-deck {
  display: grid;
  /* Buat 3 kolom di desktop */
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px; /* Jarak ke grid di bawahnya */
}

/* Penyesuaian responsif untuk 3 kolom */
@media (max-width: 992px) {
  /* Tumpuk di tablet & mobile */
  .student-stat-deck {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------- */
/* STYLE HOMEPAGE PUBLIK */
/* ------------------------------------- */

.homepage-wrapper {
  background-color: var(--white-color);
}

/* 1. Header Publik */
.public-header {
  background-color: var(--white-color);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 950;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.public-header .logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.public-header .logo i {
  margin-right: 10px;
}

/* 2. Hero Section */
.hero-section {
  background-color: var(--primary-color);
  color: var(--white-color);
  text-align: center;
  padding: 80px 30px;
}

.hero-section .hero-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.8;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
}

.hero-section p {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto 30px auto;
  opacity: 0.9;
}

.btn-hero {
  background-color: var(--white-color);
  color: var(--primary-color);
  padding: 12px 30px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 5px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-hero:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* 3. Features Section */
.features-section {
  padding: 60px 30px;
  text-align: center;
  background-color: var(--white-color);
}

.features-section h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.features-section > p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 40px;
}

.features-grid {
  display: grid;
  /* 3 kolom di desktop */
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  max-width: 1100px;
  margin: 0 auto;
}

.feature-card {
  /* Kita gunakan style .card yang sudah ada */
  background-color: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  padding: 30px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.feature-icon {
  font-size: 2.5rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.6;
}

/* 4. Pengumuman Section */
.announcement-section {
  padding: 60px 30px;
  background-color: var(--secondary-color);
}

.announcement-section h2 {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
}

.announcement-list {
  list-style-type: none;
  padding: 0;
  max-width: 700px;
  margin: 0 auto;
}

.announcement-list li {
  background-color: var(--white-color);
  padding: 20px;
  margin-bottom: 15px;
  border-radius: 5px;
  border-left: 5px solid var(--primary-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease;
}

.announcement-list li:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.announcement-list .date {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #777;
  margin-bottom: 8px;
}

.announcement-list a {
  text-decoration: none;
  color: var(--text-color);
  font-size: 1.05rem;
  font-weight: 600;
}

.announcement-list a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* 5. Footer Publik */
.public-footer {
  text-align: center;
  padding: 30px;
  background-color: #333;
  color: #aaa;
  font-size: 0.9rem;
}

.public-footer p {
  margin: 5px 0;
}

/* 6. Responsif untuk Homepage */
@media (max-width: 992px) {
  /* Buat 2 kolom di tablet */
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .public-header {
    flex-direction: column;
    gap: 15px;
  }

  .hero-section h1 {
    font-size: 2rem;
  }

  /* Buat 1 kolom di mobile */
  .features-grid {
    grid-template-columns: 1fr;
  }

  .features-section,
  .announcement-section {
    padding: 40px 20px;
  }
}

/* ------------------------------------- */
/* Tabel Persetujuan KRS (Footer) */
/* ------------------------------------- */
.schedule-table tfoot tr {
  background-color: var(--secondary-color);
}
.schedule-table tfoot td {
  padding: 12px 15px;
  border: 1px solid var(--border-color);
}

/* ------------------------------------- */
/* STYLE Halaman Detail Pengumuman */
/* ------------------------------------- */

.detail-container {
  max-width: 800px;
  margin: 0 auto; /* Tengah */
  padding: 30px;
}

.detail-container h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.3;
}

.meta-info {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 15px;
}

.meta-info i {
  margin-right: 5px;
  color: var(--primary-color);
}

.content-body {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-color);
}

/* ------------------------------------- */
/* Foto Profil & Topbar Avatar */
/* ------------------------------------- */

/* Avatar Kecil di Topbar */
.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover; /* Pastikan gambar tidak peyang */
  margin-right: 10px;
  border: 2px solid var(--border-color);
}

/* Tampilan Foto di Halaman Edit Profil */
.profile-pic-container {
  text-align: center;
  margin-bottom: 20px;
}

.profile-pic-large {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--white-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Pastikan input file tidak aneh */
input[type="file"].form-control {
  padding: 8px;
  line-height: 1.5;
}

/* ------------------------------------- */
/* Topbar User Dropdown */
/* ------------------------------------- */

/* Pastikan .user-info bisa menampung dropdown */
.user-info {
  position: relative;
  display: flex;
  align-items: center;
}

.user-dropdown-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: background-color 0.2s;
}

.user-dropdown-toggle:hover {
  background-color: var(--secondary-color);
}

.topbar-username {
  font-weight: 600;
  margin-right: 8px;
  color: var(--text-color);
}

.dropdown-caret {
  font-size: 0.8rem;
  color: #666;
}

/* Menu Dropdown yang tersembunyi */
.dropdown-menu {
  display: none; /* Sembunyi by default */
  position: absolute;
  top: calc(100% + 5px); /* Tepat di bawah trigger */
  right: 0;
  width: 240px;
  background-color: var(--white-color);
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  z-index: 1001; /* Di atas segalanya */
  padding: 8px 0;
}

/* Class 'show' untuk menampilkan */
.dropdown-menu.show {
  display: block;
}

.dropdown-header {
  padding: 10px 15px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 5px;
}
.dropdown-header small {
  font-size: 0.8rem;
  color: #555;
}
.dropdown-header strong {
  font-size: 0.9rem;
  color: var(--text-color);
  word-break: break-all;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  font-size: 0.95rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.2s;
}

.dropdown-item i {
  width: 25px;
  color: #777;
  margin-right: 10px;
}

.dropdown-item:hover {
  background-color: var(--secondary-color);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 5px 0;
}

.dropdown-item.logout-link {
  color: var(--danger-color);
}
.dropdown-item.logout-link i {
  color: var(--danger-color);
}

/* ------------------------------------- */
/* Sidebar Dropdown Menu (Kategori) */
/* ------------------------------------- */

/* Pastikan <li> bisa jadi 'anchor' */
.sidebar-item {
  position: relative;
}

.sidebar-item a {
  position: relative;
}

/* Chevron (panah bawah) di link utama */
.sidebar-link.has-submenu .chevron-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

/* Rotasi chevron saat 'active' (sidebar terbuka) */
.sidebar-item.active > .sidebar-link.has-submenu .chevron-icon {
  transform: translateY(-50%) rotate(180deg);
}

/* --- Perilaku Submenu (Default & Saat Terbuka) --- */

.sidebar-submenu {
  list-style-type: none;
  padding: 0;
  margin: 0;
  background-color: rgba(0, 0, 0, 0.15); /* Sedikit lebih gelap */
  /* Sembunyikan dengan max-height untuk transisi animasi */
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  /* Ini untuk state collapsed */
  position: static;
  width: 100%;
}

/* Tampilkan submenu saat item .active (diberi oleh JS) */
.sidebar-item.active > .sidebar-submenu {
  max-height: 500px; /* Ketinggian maks yang wajar */
  transition: max-height 0.4s ease-in;
}

/* Link di dalam submenu */
.sidebar-submenu a {
  padding-left: 55px; /* Indentasi agar rapi (Ikon + Spasi) */
  font-size: 0.9rem;
  opacity: 0.9;
  white-space: nowrap; /* Cegah teks turun baris */
}

.sidebar-submenu a.active {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: 600;
  opacity: 1;
}

/* -------------------------------------------------- */
/* INI PERBAIKAN UTAMANYA: Perilaku Saat Sidebar Diciutkan */
/* -------------------------------------------------- */
@media (min-width: 769px) {
  /* Saat diciutkan, sembunyikan chevron */
  .dashboard-wrapper.sidebar-toggled .sidebar-link.has-submenu .chevron-icon {
    display: none;
  }

  /* Ubah submenu menjadi 'fly-out' (melayang) */
  .dashboard-wrapper.sidebar-toggled .sidebar-submenu {
    position: absolute;
    left: 80px; /* Muncul di sebelah kanan sidebar (lebar 80px) */
    top: 0;
    width: 220px; /* Lebar menu fly-out */
    background-color: var(--primary-color); /* Latar belakang solid */
    border-radius: 0 5px 5px 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);

    /* Sembunyikan dan siapkan untuk :hover */
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, max-height 0s 0.3s, visibility 0s 0.3s;
  }

  /* Tampilkan fly-out saat item di-HOVER (bukan klik) */
  .dashboard-wrapper.sidebar-toggled .sidebar-item:hover > .sidebar-submenu {
    max-height: 500px; /* Tampilkan */
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease;
  }

  /* Perbaiki style link di dalam fly-out */
  .dashboard-wrapper.sidebar-toggled .sidebar-submenu a {
    padding: 12px 20px; /* Reset padding */
    font-size: 0.9rem;
    color: var(--white-color); /* Pastikan teks putih */
  }

  .dashboard-wrapper.sidebar-toggled .sidebar-submenu a:hover,
  .dashboard-wrapper.sidebar-toggled .sidebar-submenu a.active {
    background-color: rgba(255, 255, 255, 0.1);
  }
}

/* ------------------------------------- */
/* Form Pencarian (Admin) */
/* ------------------------------------- */
.search-form {
  display: flex;
  gap: 10px;
}
.search-form .form-control {
  flex: 1; /* Input mengambil sisa ruang */
}
.search-form .btn-primary {
  width: auto; /* Tombol tidak full width */
}

/* ------------------------------------- */
/* Paginasi (Pagination) */
/* ------------------------------------- */
.pagination-container {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
.pagination {
  list-style-type: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 5px;
}
.pagination li a {
  display: block;
  padding: 8px 14px;
  color: var(--primary-color);
  text-decoration: none;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  transition: background-color 0.2s, color 0.2s;
}
.pagination li a:hover {
  background-color: var(--secondary-color);
}
.pagination li a.active {
  background-color: var(--primary-color);
  color: var(--white-color);
  border-color: var(--primary-color);
}
