:root {
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --success-bg: #f0fdf4;
  --success-text: #15803d;
  --warning-bg: #fffbeb;
  --warning-text: #92400e;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
}

.app-shell {
  min-height: 100vh;
}

.main-content {
  margin-left: 280px;
  width: calc(100% - 280px);
  min-height: 100vh;
  padding: 28px 32px;
  overflow-x: hidden;
}

.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 4px;
  text-align: left;
}

.page-header p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.content-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.error-box {
  color: var(--danger-text);
}

.page-footer {
  margin-top: 28px;
  padding: 14px 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 768px) {
  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 76px 16px 24px;
  }

  .page-header h1 {
    font-size: 22px;
  }

  .content-card {
    padding: 16px;
    border-radius: 16px;
  }
}

.table-card,
.filter-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
}

.table-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}

.table-header h2,
.filter-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.table-subtitle,
.filter-header p {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.filter-card {
  padding: 18px 22px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.filter-box {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.filter-item {
  width: 100%;
}

.filter-item label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
}

.filter-item select {
  width: 100%;
  height: 46px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 14px;
  background: #fff;
}

.btn-reset-filter {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.table-responsive {
  padding: 18px 22px;
  overflow-x: auto;
}

@media (max-width: 768px) {
  .filter-header,
  .filter-box {
    flex-direction: column;
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .filter-item select {
    width: 100%;
  }
}

.btn-table-action {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-icon-action {
  width: 34px;
  height: 34px;
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #f8fafc;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-icon-action:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.btn-icon-action i {
  font-size: 18px;
}

table.dataTable thead th {
  background: #f8fafc !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  padding: 14px 12px !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

table.dataTable tbody td {
  font-size: 13px !important;
  padding: 12px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #eef2f7 !important;
}

table.dataTable tbody tr:hover {
  background: #f8fafc !important;
}

.info-card {
  margin-top: 24px;
  background: #fffdf4;
  border: 1px solid #f3e8b3;
  border-radius: 14px;
  padding: 20px 24px;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-weight: 700;
  color: #92400e;
  font-size: 15px;
}

.info-card-header i {
  font-size: 20px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 30px;
  font-size: 14px;
  color: #374151;
}

.status-grid div {
  white-space: nowrap;
}

.status-grid strong {
  color: #111827;
}

.sync-action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 18px;
}

.sync-action-grid .btn-action {
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .sync-action-grid {
    grid-template-columns: 1fr;
  }
}

.sync-card {
  background: #fff;
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
}

.sync-card-header h2 {
  margin: 0;
  font-size: 18px;
}

.sync-card-header p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.sync-module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.sync-module-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 16px;
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
}

.sync-module-item:hover:not(:disabled) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.sync-module-item:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.sync-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eaf1ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}

.sync-module-item strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.sync-module-item small {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: #64748b;
}

@media (max-width: 900px) {
  .sync-module-grid {
    grid-template-columns: 1fr;
  }
}

.sync-alert {
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.sync-alert-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.sync-alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.sync-content {
  flex: 1;
  position: relative;
}

.sync-content em {
  display: block;
  margin-top: 6px;
  font-size: 9px;
  font-style: normal;
  color: #94a3b8;
}

.sync-progress {
  display: none;
  margin-top: 10px;
  width: 100%;
  height: 5px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.sync-progress-bar {
  width: 0%;
  height: 100%;
  background: #38bdf8;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.sync-percent {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: #64748b;
}

.sync-module-item.is-syncing .sync-progress,
.sync-module-item.is-syncing .sync-percent {
  display: block;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-success {
  background: #dcfce7;
  color: #15803d;
}

.badge-danger {
  background: #fee2e2;
  color: #dc2626;
}

.badge-warning {
  background: #fef3c7;
  color: #b45309;
}

.badge-secondary {
  background: #e5e7eb;
  color: #475569;
}

.badge-failed {
  background: #fee2e2;
  color: #dc2626;
}

.badge-running {
  background: #e0f2fe;
  color: #0369a1;
}

.badge-cancelled {
  background: #f1f5f9;
  color: #64748b;
}

/* ── Progress bar di dalam kolom Status tabel riwayat ─────────────────────── */
.sync-status-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.sync-status-progress .ssp-track {
  width: 100%;
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.sync-status-progress .ssp-fill {
  height: 100%;
  background: #38bdf8;
  border-radius: 999px;
  transition: width 0.4s ease;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.25) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.25) 50%,
    rgba(255, 255, 255, 0.25) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: sspStripes 1s linear infinite;
}

@keyframes sspStripes {
  from {
    background-position: 1rem 0;
  }
  to {
    background-position: 0 0;
  }
}

.sync-status-progress .ssp-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
  font-size: 11px;
  color: #475569;
}

.sync-status-progress .ssp-pct {
  font-weight: 700;
  color: #0369a1;
}

.sync-status-progress .ssp-count {
  color: #94a3b8;
}

/* Bar indeterminate (master sync yang totalnya belum diketahui). */
.sync-status-progress .ssp-fill.ssp-indeterminate,
.sync-progress-bar.is-indeterminate {
  background-color: #38bdf8;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.5) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0.5) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: sspIndeterminate 0.9s linear infinite;
}

@keyframes sspIndeterminate {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 1rem 0;
  }
}

/* Untuk tombol sinkronisasi background, progres kartu selalu terlihat
   (bukan hanya saat proses berjalan) supaya admin tahu tingkat kelengkapan. */
.sync-bg-btn .sync-progress,
.sync-bg-btn .sync-percent {
  display: block;
}

/* ── Bar tombol "Hentikan" untuk job yang sedang berjalan ─────────────────── */
.sync-stop-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 18px;
}

.sync-stop-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sync-stop-btn:hover {
  background: #fee2e2;
}

.sync-stop-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* dosen details */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.detail-item {
  padding: 16px;
  border: 1px solid #e5eaf3;
  border-radius: 14px;
  background: #f8fafc;
}

.detail-item span {
  display: block;
  font-size: 13px;
  color: #7b8aa5;
  margin-bottom: 6px;
}

.detail-item strong {
  display: block;
  font-size: 15px;
  color: #1f2a44;
  font-weight: 600;
}

@media (max-width: 768px) {
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.detail-tabs {
  display: flex;
  gap: 8px;
  margin: 24px 0 18px;
  border-bottom: 1px solid #e5eaf3;
  flex-wrap: wrap;
}

.detail-tab {
  border: 0;
  background: #eef4ff;
  color: #52637a;
  padding: 11px 18px;
  border-radius: 12px 12px 0 0;
  font-weight: 600;
  cursor: pointer;
}

.detail-tab.active {
  background: #2563eb;
  color: #ffffff;
}

.detail-tab-content {
  display: none;
}

.detail-tab-content.active {
  display: block;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.btn-back-modern {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #eef4ff;
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.pegawai-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 24px;
}

.pegawai-photo {
  height: 160px;
  border-radius: 12px;
  background: #2c2613;
  color: #fff;
  font-size: 64px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pegawai-menu {
  margin-top: 16px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  overflow: hidden;
}

.pegawai-menu a {
  display: block;
  padding: 13px 14px;
  background: #f1f7ff;
  color: #52637a;
  text-decoration: none;
  border-bottom: 1px solid #dbe4f0;
  font-weight: 500;
}

.pegawai-menu a.active {
  background: #e6f2ff;
  color: #2563eb;
  border-left: 4px solid #2563eb;
}

.pegawai-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.info-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  min-height: 34px;
  border-bottom: 1px solid #e7edf5;
  align-items: center;
}

.info-row label {
  color: #6d7ed3;
  font-weight: 700;
  font-size: 14px;
}

.info-row span {
  color: #111827;
  font-size: 14px;
}

.siakad-tabs {
  margin-top: 24px;
  margin-bottom: 0;
}

.boxed {
  border: 1px solid #dbe4f0;
  padding: 10px 14px;
  border-radius: 0 10px 10px 10px;
}

@media (max-width: 900px) {
  .pegawai-layout,
  .pegawai-two-col {
    grid-template-columns: 1fr;
  }

  .info-row {
    grid-template-columns: 1fr;
    padding: 8px 0;
  }
}
/* end dosen detail */

/* //jadwal dosen */
.dosen-jadwal-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: #eef6ff;
  border-radius: 10px;
}

.dosen-jadwal-summary > div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  padding: 6px 0;
}

.dosen-jadwal-summary span {
  color: #6677d9;
  font-weight: 700;
}

.dosen-jadwal-summary strong {
  color: #172033;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.jadwal-filter {
  display: grid;
  grid-template-columns: 180px minmax(240px, 390px);
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

.jadwal-filter label {
  color: #6677d9;
  font-weight: 700;
}

.jadwal-filter select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #ffffff;
}

.jadwal-table {
  width: 100%;
  border-collapse: collapse;
}

.jadwal-table th,
.jadwal-table td {
  padding: 11px 12px;
  border: 1px solid #dfe6ef;
  vertical-align: middle;
}

.jadwal-table th {
  background: #0b568f;
  color: #ffffff;
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.jadwal-table td {
  font-size: 13px;
}

.jadwal-table td:first-child,
.jadwal-table td:nth-child(4),
.jadwal-table td:nth-child(5),
.jadwal-table td:nth-child(6),
.jadwal-table td:last-child {
  text-align: center;
}

.empty-table {
  padding: 30px !important;
  text-align: center !important;
  color: #8190a6;
}

@media (max-width: 1100px) {
  .dosen-jadwal-summary {
    grid-template-columns: 1fr;
  }

  .jadwal-filter {
    grid-template-columns: 1fr;
  }
}

.pegawai-menu a.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.pegawai-menu a.disabled small {
  display: block;
  margin-left: 28px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
}
/* //jadwal dosen */

/* mahasiswa */
.mahasiswa-detail-card {
  overflow: hidden;
}

.mahasiswa-detail-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
}

.mahasiswa-detail-side {
  border: 1px solid #dce5f4;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.mahasiswa-avatar {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #24324a;
  color: #fff;
  font-size: 58px;
  font-weight: 700;
  letter-spacing: 2px;
}

.mahasiswa-side-summary {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mahasiswa-side-summary strong {
  font-size: 16px;
  color: #1f2937;
}

.mahasiswa-side-summary span {
  color: #2563eb;
  font-weight: 600;
}

.mahasiswa-side-summary small {
  color: #64748b;
  line-height: 1.5;
}

.mahasiswa-detail-main {
  min-width: 0;
}

@media (max-width: 992px) {
  .mahasiswa-detail-layout {
    grid-template-columns: 1fr;
  }

  .mahasiswa-detail-side {
    max-width: 420px;
  }
}
/* mahasiswa */

/* ── Analisa OBE pada Detail Mahasiswa ─────────────────────────────────────── */
.obe-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.obe-stat {
  flex: 1 1 140px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.obe-stat-label {
  font-size: 12px;
  color: #64748b;
}

.obe-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
}

.obe-chart-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

.obe-chart {
  flex: 1 1 380px;
  min-width: 320px;
}

.obe-chart-side {
  flex: 1 1 320px;
  min-width: 280px;
}

.obe-chart h4,
.obe-chart-side h4,
.obe-subhead {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 10px;
}

.obe-subhead {
  margin-top: 20px;
}

.obe-subhead small {
  font-weight: 500;
  color: #64748b;
  margin-left: 8px;
}

.radar-svg {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
}

.radar-svg .radar-label {
  font-size: 11px;
  font-weight: 600;
  fill: #334155;
}

.radar-svg .radar-scale {
  font-size: 9px;
  fill: #94a3b8;
}

.radar-empty,
.empty-note {
  padding: 16px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  color: #64748b;
  font-size: 13px;
}

.radar-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #475569;
  margin-top: 8px;
}

.radar-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 5px;
  vertical-align: middle;
}

.radar-legend .dot-mhs {
  background: rgba(56, 189, 248, 0.5);
  border: 2px solid #0284c7;
}

.radar-legend .dot-avg {
  background: rgba(148, 163, 184, 0.25);
  border: 2px dashed #94a3b8;
}

.obe-table-sm {
  width: 100%;
  font-size: 13px;
}

.obe-table-sm th,
.obe-table-sm td {
  padding: 7px 9px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
}

.obe-table-sm thead th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
}

.obe-table-sm small {
  color: #94a3b8;
}

/* =========================================================
   Shared Select2 styling for OBE filter controls
   ========================================================= */
.filter-item .select2-container {
  width: 100% !important;
}

.filter-item .select2-container .select2-selection--single {
  height: 46px;
  border: 1px solid #dbe2ea;
  border-radius: 12px;
  background: #fff;
  display: flex;
  align-items: center;
}

.filter-item .select2-container--default .select2-selection--single .select2-selection__rendered {
  width: 100%;
  padding: 0 42px 0 16px;
  line-height: 44px;
  font-size: 14px;
  color: var(--text-primary);
}

.filter-item .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 44px;
  right: 10px;
}

.filter-item .select2-container--default.select2-container--focus .select2-selection--single,
.filter-item .select2-container--default.select2-container--open .select2-selection--single {
  border-color: #93b4f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.select2-container--default .select2-dropdown {
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}

.select2-container--default .select2-search--dropdown {
  padding: 10px;
  background: #fff;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
  width: 100%;
  height: 40px;
  border: 1px solid #dbe2ea;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
  border-color: #93b4f8;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

.select2-container--default .select2-results__option {
  padding: 9px 12px;
  font-size: 14px;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: #2563eb;
}
