/* =====================================================================
   Rekrutmen Sekolah Athalia — tampilan modern (Bootstrap 5.3 + jQuery)
   Identitas: gradasi "alur seleksi" hijau daun -> teal -> biru Athalia
   ===================================================================== */
:root {
  --ath-blue: #00457C;
  --ath-blue-600: #003a68;
  --ath-teal: #0F7A73;
  --ath-green: #1F932D;
  --ath-ink: #15324d;
  --ath-muted: #5d7287;
  --ath-paper: #F3F6F4;
  --ath-panel: #ffffff;
  --ath-line: #dbe3e0;
  --ath-line-soft: #e9eeec;
  --ath-tint: #e8f0f7;
  --ath-danger: #c9362f;
  --ath-warn: #b7791f;
  --ath-journey: linear-gradient(90deg, #1F932D 0%, #0F7A73 50%, #00457C 100%);
  --ath-radius-lg: 18px;
  --ath-radius: 12px;
  --ath-radius-sm: 8px;
  --ath-shadow: 0 1px 2px rgba(21, 50, 77, .06), 0 8px 24px -12px rgba(21, 50, 77, .18);
  --topbar-h: 64px;

  --bs-body-font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-color: var(--ath-ink);
  --bs-body-bg: var(--ath-paper);
  --bs-primary: #00457C;
  --bs-primary-rgb: 0, 69, 124;
  --bs-link-color: #00457C;
  --bs-link-color-rgb: 0, 69, 124;
  --bs-link-hover-color: #0F7A73;
  --bs-border-color: var(--ath-line);
  --bs-border-radius: var(--ath-radius-sm);
}

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 72px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

body {
  font-family: var(--bs-body-font-family);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ath-ink);
  background: var(--ath-paper);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--ath-blue); text-underline-offset: 3px; }
a:hover { color: var(--ath-teal); }
:focus-visible { outline: 3px solid rgba(15, 122, 115, .45); outline-offset: 2px; }
::selection { background: #cfe5dc; }

/* ---------------------------------------------------------------------
   Progress bar global (tampil di setiap proses)
   --------------------------------------------------------------------- */
#app-progress {
  position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 2000000;
  pointer-events: none; opacity: 0; transition: opacity .25s ease;
}
#app-progress .bar {
  height: 100%; width: 0; background: var(--ath-journey);
  box-shadow: 0 0 10px rgba(15, 122, 115, .6);
  transition: width .3s ease;
}
#app-progress.active { opacity: 1; }

/* Overlay loading (dipakai show_loading()/hide_loading()) */
.loading.overlay {
  display: none;
  position: fixed; inset: 0; z-index: 1999999;
  background: rgba(16, 38, 58, .38);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.loading-card {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(320px, calc(100vw - 48px));
  background: #fff; border-radius: var(--ath-radius-lg);
  padding: 22px 24px 20px; text-align: left;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .45);
}
.loading-card .loading-title { font-weight: 700; font-size: 15px; margin: 0 0 2px; color: var(--ath-ink); }
.loading-card .loading-sub { font-size: 13px; color: var(--ath-muted); margin: 0 0 14px; }
.loading-track { height: 6px; border-radius: 99px; background: var(--ath-line-soft); overflow: hidden; position: relative; }
.loading-track::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%;
  border-radius: 99px; background: var(--ath-journey);
  animation: ath-indeterminate 1.1s ease-in-out infinite;
}
@keyframes ath-indeterminate { 0% { left: -40%; } 100% { left: 100%; } }

/* Tombol sedang memproses */
.btn.is-loading, a.is-loading { position: relative; pointer-events: none; opacity: .85; }
.btn.is-loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: ath-spin .7s linear infinite;
}
@keyframes ath-spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------------
   Topbar & kerangka halaman
   --------------------------------------------------------------------- */
.app-topbar {
  position: sticky; top: 0; z-index: 1030;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: saturate(160%) blur(10px); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--ath-line);
}
.app-topbar .inner { height: 100%; display: flex; align-items: center; gap: 12px; }
.app-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ath-ink); min-width: 0; }
.app-brand img { width: 38px; height: 38px; object-fit: contain; flex: none; }
.app-brand .brand-text { line-height: 1.15; min-width: 0; }
.app-brand .brand-name { display: block; font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-brand .brand-sub { display: block; font-size: 12px; color: var(--ath-muted); white-space: nowrap; }
.app-topbar .topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.user-chip {
  display: inline-flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px;
  border: 1px solid var(--ath-line); border-radius: 99px; background: #fff; color: var(--ath-ink);
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.user-chip:hover { border-color: #b9c8c3; color: var(--ath-ink); }
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ath-journey); color: #fff; font-size: 13px; font-weight: 700;
}
.dropdown-menu { border-color: var(--ath-line); border-radius: var(--ath-radius); box-shadow: var(--ath-shadow); padding: 6px; }
.dropdown-item { border-radius: var(--ath-radius-sm); padding: 8px 12px; font-size: 14px; }

.app-main { flex: 1 0 auto; padding: 28px 0 48px; }
.app-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 575.98px) { .app-container { padding: 0 14px; } .app-main { padding-top: 18px; } }

.app-footer { border-top: 1px solid var(--ath-line); background: #fff; font-size: 13px; color: var(--ath-muted); padding: 16px 0; }
.app-footer .inner { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between; }

/* ---------------------------------------------------------------------
   Judul halaman / hero
   --------------------------------------------------------------------- */
.page-head { margin-bottom: 22px; }
.page-head .kicker { font-size: 13px; color: var(--ath-teal); font-weight: 700; margin: 0 0 4px; }
.page-head h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; letter-spacing: -.025em; line-height: 1.15; margin: 0 0 6px; }
.page-head p { color: var(--ath-muted); margin: 0; max-width: 64ch; }

.hero {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 28px; align-items: center;
  margin-bottom: 26px;
}
.hero h1 { font-size: clamp(28px, 4.2vw, 46px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; margin: 0 0 14px; }
.hero h1 .journey-text { background: var(--ath-journey); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 16px; color: var(--ath-muted); max-width: 46ch; margin-bottom: 0; }
.hero .school { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--ath-blue); margin-bottom: 14px; }
.hero .school::before { content: ""; width: 22px; height: 4px; border-radius: 4px; background: var(--ath-journey); }
.hero-media { background: #fff; border: 1px solid var(--ath-line); border-radius: var(--ath-radius-lg); padding: 8px; box-shadow: var(--ath-shadow); }
.hero-media .carousel, .hero-media .carousel-inner { border-radius: 12px; overflow: hidden; }
.hero-media .carousel-item img { cursor: zoom-in; aspect-ratio: 1720 / 421; object-fit: cover; }
.hero-media .carousel-indicators { margin-bottom: .35rem; }
.hero-media .carousel-indicators [data-bs-target] { width: 18px; height: 4px; border-radius: 4px; background-color: var(--ath-blue); }
.hero-media .carousel-control-prev, .hero-media .carousel-control-next { width: 44px; }
.hero-media .carousel-control-prev-icon, .hero-media .carousel-control-next-icon { background-color: rgba(0, 69, 124, .75); border-radius: 50%; background-size: 55%; width: 30px; height: 30px; }
.hero-media .media-hint { font-size: 12px; color: var(--ath-muted); padding: 6px 6px 0; }
@media (max-width: 991.98px) { .hero { grid-template-columns: 1fr; gap: 18px; } }

/* Callout informasi */
.label-information {
  display: block; width: 100%; margin: 0 0 18px; padding: 14px 16px 14px 48px; position: relative;
  background: var(--ath-tint); border: 1px solid #cfe0ee; border-radius: var(--ath-radius);
  color: #1d4466 !important; font-size: 14px; font-weight: 400; line-height: 1.6;
}
.label-information::before {
  content: "\f05a"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  position: absolute; left: 17px; top: 14px; color: var(--ath-blue); font-size: 17px;
}
.label-information b { font-weight: 700; }
.modal .label-information { font-size: 13px; }

/* ---------------------------------------------------------------------
   Kerangka formulir: navigasi bagian (rail) + panel bagian
   --------------------------------------------------------------------- */
.form-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.form-toc { position: sticky; top: calc(var(--topbar-h) + 20px); }
.form-toc .toc-title { font-size: 13px; font-weight: 700; color: var(--ath-muted); margin: 0 0 10px 4px; }
.form-toc ol { list-style: none; margin: 0; padding: 0; position: relative; }
.form-toc ol::before { content: ""; position: absolute; left: 17px; top: 14px; bottom: 14px; width: 2px; background: var(--ath-line); border-radius: 2px; }
.form-toc li a {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 6px 10px 6px 4px;
  text-decoration: none; color: var(--ath-muted); font-size: 13.5px; font-weight: 500; border-radius: 10px; line-height: 1.3;
}
.form-toc li a .num {
  flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; border: 2px solid var(--ath-line); font-size: 12px; font-weight: 700; color: var(--ath-muted);
  transition: background .2s, border-color .2s, color .2s; position: relative; z-index: 1;
}
.form-toc li a:hover { color: var(--ath-ink); background: rgba(255, 255, 255, .7); }
.form-toc li a.is-active { color: var(--ath-ink); font-weight: 700; background: #fff; box-shadow: var(--ath-shadow); }
.form-toc li a.is-active .num, .form-toc li a.is-passed .num { background: var(--step-color, var(--ath-blue)); border-color: var(--step-color, var(--ath-blue)); color: #fff; }
.form-toc .toc-meter { margin: 14px 4px 0; font-size: 12px; color: var(--ath-muted); }
.form-toc .toc-meter .track { height: 6px; background: var(--ath-line-soft); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.form-toc .toc-meter .fill { height: 100%; width: 0; background: var(--ath-journey); border-radius: 99px; transition: width .3s ease; }

@media (max-width: 1199.98px) {
  .form-shell { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .form-toc {
    top: var(--topbar-h); z-index: 1020; margin: 0 -20px; padding: 8px 20px;
    background: rgba(243, 246, 244, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--ath-line);
  }
  .form-toc .toc-title, .form-toc .toc-meter { display: none; }
  .form-toc ol { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .form-toc ol::-webkit-scrollbar { display: none; }
  .form-toc ol::before { display: none; }
  .form-toc li { flex: none; }
  .form-toc li a { padding: 4px 12px 4px 4px; background: #fff; border: 1px solid var(--ath-line); border-radius: 99px; white-space: nowrap; font-size: 13px; }
  .form-toc li a .num { width: 24px; height: 24px; font-size: 11px; border-width: 0; background: var(--ath-line-soft); }
  .form-toc li a.is-active { box-shadow: none; border-color: var(--step-color, var(--ath-blue)); }
}
@media (max-width: 575.98px) { .form-toc { margin: 0 -14px; padding: 8px 14px; } }

/* Panel bagian formulir */
.form-section {
  background: var(--ath-panel); border: 1px solid var(--ath-line); border-radius: var(--ath-radius-lg);
  padding: 24px 26px 18px; margin-bottom: 20px; box-shadow: var(--ath-shadow);
}
@media (max-width: 575.98px) { .form-section { padding: 18px 16px 12px; border-radius: 14px; } }

.label-banner { display: flex; align-items: center; gap: 14px; margin: 0 0 20px; padding: 0 0 16px; border-bottom: 1px solid var(--ath-line-soft); background: none; color: var(--ath-ink); text-align: left; }
.label-banner .step-num {
  flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--step-color, var(--ath-blue)); color: #fff; font-weight: 800; font-size: 15px;
}
.label-banner .section-title { font-size: 19px; font-weight: 800; letter-spacing: -.015em; margin: 0; line-height: 1.25; color: var(--ath-ink); }
.label-banner label { color: var(--ath-ink) !important; }

.sub-section-title {
  display: flex; align-items: center; gap: 10px; font-size: 15.5px; font-weight: 700; color: var(--ath-blue);
  margin: 22px 0 12px; line-height: 1.3;
}
.sub-section-title:first-child { margin-top: 4px; }
.sub-section-title i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--ath-tint); font-size: 14px; }

/* Grup pertanyaan (alamat, riwayat kesehatan, dst.) */
.box-group-question { background: #f8faf9; border: 1px dashed #cbd7d3; border-radius: var(--ath-radius); padding: 16px 16px 6px; }
.box-group-label { font-weight: 700; font-size: 14.5px; margin: 8px 0 8px !important; display: block; color: var(--ath-ink) !important; }

/* ---------------------------------------------------------------------
   Input
   --------------------------------------------------------------------- */
label { color: var(--ath-ink); }
.form-label { font-weight: 600; font-size: 14px; margin-bottom: 6px !important; color: var(--ath-ink); line-height: 1.45; }
.form-label i, .form-label .star-required i { font-weight: 400; }
.star-required { color: var(--ath-danger); font-weight: 700; }
.form-label .star-required i, .form-label .star-required br + i { display: inline-block; color: var(--ath-muted); font-weight: 400; font-size: 12.5px; font-style: normal; margin-top: 2px; }

.form-control, .form-select {
  border: 1px solid #cdd8d4; border-radius: var(--ath-radius-sm); padding: .6rem .8rem; font-size: 14.5px;
  color: var(--ath-ink); background-color: #fff; transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: #9aa9b5; }
.form-control:focus, .form-select:focus { border-color: var(--ath-teal); box-shadow: 0 0 0 4px rgba(15, 122, 115, .14); }
.form-control[readonly]:not([type="file"]) { background-color: #f6f8f7; }
textarea.form-control { line-height: 1.6; resize: vertical; }
.form-control.is-invalid, .was-validated .form-control:invalid { border-color: var(--ath-danger); background-image: none; padding-right: .8rem; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 4px rgba(201, 54, 47, .14); }
input[type="file"].form-control { padding: .45rem .5rem; }
input[type="file"].form-control::file-selector-button {
  border: 0; border-radius: 6px; background: var(--ath-tint); color: var(--ath-blue); font-weight: 600;
  padding: .35rem .8rem; margin-right: .75rem;
}
.text-error { display: block; font-size: 13px; color: var(--ath-danger); margin-top: 4px; font-weight: 500; }
.text-error:empty { display: none; }
.text-error-table { margin: 8px 0 0 !important; }

/* Pilihan radio -> pil */
.radio-control.form-control { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; background: transparent; box-shadow: none; height: auto; }
.radio-control .radio-button {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 !important; cursor: pointer;
  padding: 8px 14px; border: 1px solid #cdd8d4; border-radius: 99px; background: #fff; font-size: 14px; font-weight: 500;
  transition: border-color .15s, background .15s, color .15s;
}
.radio-control .radio-button:hover { border-color: var(--ath-teal); }
.radio-control .radio-button input { accent-color: var(--ath-teal); width: 16px; height: 16px; margin: 0; }
.radio-control .radio-button:has(input:checked) { border-color: var(--ath-teal); background: #e7f4f1; color: #0b5c56; font-weight: 600; }
.radio-control .radio-button:has(input:focus-visible) { outline: 3px solid rgba(15, 122, 115, .35); outline-offset: 2px; }
.radio-control .radio-button:has(input:disabled) { cursor: default; }

/* Checkbox */
.form-check { padding-left: 1.9em; margin-bottom: 10px; }
.form-check .form-check-input { width: 1.2em; height: 1.2em; margin-left: -1.9em; margin-top: .2em; border-color: #b9c8c3; cursor: pointer; }
.form-check-input:checked { background-color: var(--ath-teal); border-color: var(--ath-teal); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(15, 122, 115, .15); border-color: var(--ath-teal); }
.form-check-label { cursor: pointer; }

/* Posisi yang dilamar */
.position-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 4px 0 6px; }
.position-list .row { margin: 0 !important; }
.position-list .form-check {
  display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; min-height: 48px;
  border: 1px solid var(--ath-line); border-radius: var(--ath-radius); background: #fff; transition: border-color .15s, background .15s;
}
.position-list .form-check:has(.form-check-input:checked) { border-color: var(--ath-teal); background: #f0f8f6; }
.position-list .form-check .form-check-input { margin: 0; flex: none; float: none; }
.position-list .form-check-label { flex: 1; font-weight: 500; font-size: 14px; line-height: 1.35; }
.stars i { cursor: pointer; font-size: 17px; color: #d4dcd9; transition: color .2s ease, transform .2s ease; }
.stars i:hover { transform: scale(1.12); }
.stars i.active-star { color: #f2a516; }

/* Foto */
.box-image { display: inline-block; padding: 6px; background: #fff; border: 1px solid var(--ath-line); border-radius: var(--ath-radius); }
.img-photo, .img-ktp { display: block; height: 180px; max-width: 100%; object-fit: cover; border-radius: 8px; background: #f2f5f4; }
.img-photo { width: 135px; }
.img-ktp { width: 290px; }
.file-image { max-width: 100%; height: auto; border-radius: 8px; }
.box-file-image { text-align: center; }

/* ---------------------------------------------------------------------
   Tombol
   --------------------------------------------------------------------- */
.btn { font-weight: 600; font-size: 14px; border-radius: 10px; padding: .6rem 1.1rem; letter-spacing: 0; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn-blue, .btn-primary {
  background: var(--ath-blue) !important; border: 1px solid var(--ath-blue) !important; color: #fff !important; min-width: 120px;
}
.btn-blue:hover, .btn-primary:hover { background: var(--ath-blue-600) !important; border-color: var(--ath-blue-600) !important; box-shadow: 0 6px 16px -8px rgba(0, 69, 124, .7); }
.btn-gray, .btn-secondary { background: #fff !important; border: 1px solid #c6d3cf !important; color: var(--ath-ink) !important; min-width: 100px; }
.btn-gray:hover, .btn-secondary:hover { background: #f2f5f4 !important; border-color: #aebfba !important; }
.btn-blue-mini, .btn-yellow-mini {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 72px; padding: .3rem .7rem; font-size: 12.5px; border-radius: 8px; margin-left: 0 !important;
}
.btn-blue-mini { background: var(--ath-tint); color: var(--ath-blue); border: 1px solid #cfe0ee; }
.btn-blue-mini:hover { background: var(--ath-blue); color: #fff; border-color: var(--ath-blue); }
.btn-yellow-mini { background: #fff6e2; color: #7a5300; border: 1px solid #f1d699; }
.btn-yellow-mini:hover { background: #f2a516; color: #fff; border-color: #f2a516; }
.btn-modal { min-width: 110px; }
.btn-disabled, .btn.btn-disabled { pointer-events: none !important; cursor: not-allowed !important; background: #e3e9e7 !important; color: #8a9aa6 !important; border-color: #e3e9e7 !important; box-shadow: none !important; }
.btn-icon, .button-icon, .btn-icon-refresh { background: var(--ath-blue); color: #fff; border-radius: 8px; }
.button-delete { color: var(--ath-danger) !important; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.button-delete:hover { background: #fdecea; }
.button-edit { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; }
.button-edit:hover { background: var(--ath-tint); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 575.98px) { .form-actions .btn { flex: 1 1 auto; } }

/* Baris "tambah data" di atas tabel */
.add-row-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; flex-wrap: wrap; }
.add-row-bar .add-row-text { margin: 0; font-size: 14px; color: var(--ath-muted); }
.add-row-bar .add-row-text b { color: var(--ath-ink); font-weight: 600; }
.btn-add-row {
  display: inline-flex; align-items: center; gap: 8px; padding: .45rem .9rem; font-size: 13.5px;
  background: #fff; color: var(--ath-teal); border: 1px dashed var(--ath-teal); border-radius: 10px;
}
.btn-add-row:hover { background: #e7f4f1; color: #0b5c56; border-style: solid; }

/* ---------------------------------------------------------------------
   Kartu & tabel
   --------------------------------------------------------------------- */
.card { border: 1px solid var(--ath-line); border-radius: var(--ath-radius); box-shadow: none; }
.panel { background: #fff; border: 1px solid var(--ath-line); border-radius: var(--ath-radius-lg); box-shadow: var(--ath-shadow); padding: 22px; margin-bottom: 20px; }
.panel-title { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; }
.panel-sub { font-size: 13.5px; color: var(--ath-muted); margin: 0 0 16px; }
@media (max-width: 575.98px) { .panel { padding: 16px; } }

.card-table { overflow: hidden; margin-bottom: 4px; }
.card-table .table-responsive, .panel .table-responsive { margin: 0; }
.table { --bs-table-bg: transparent; --bs-table-striped-bg: #f7faf9; margin-bottom: 0 !important; font-size: 13.5px; color: var(--ath-ink); }
.table > :not(caption) > * > * { padding: .65rem .8rem; border-bottom-color: var(--ath-line-soft); vertical-align: middle; }
#head-table, .table thead { background: #f1f5f4 !important; color: var(--ath-ink) !important; }
.table thead th, table.dataTable thead th, table.dataTable thead td {
  font-weight: 700; font-size: 12.5px; color: #3e5568; border-bottom: 1px solid var(--ath-line) !important;
  padding: .7rem .8rem !important; white-space: nowrap; vertical-align: middle !important;
}
.card-table table.dataTable thead th { white-space: normal; min-width: 110px; }
table.dataTable { border-collapse: collapse !important; margin: 0 !important; width: 100% !important; }
table.dataTable.no-footer { border-bottom: 0 !important; }
table.dataTable tbody td { border-top: 0 !important; }
table.dataTable td.dataTables_empty { color: var(--ath-muted); padding: 22px !important; text-align: center; font-size: 13.5px; }
.row-active { background-color: var(--ath-blue) !important; color: #fff !important; }

/* Kontrol DataTables */
.dataTables_wrapper { font-size: 13.5px; }
.dataTables_wrapper .dataTables_filter { margin-bottom: 12px !important; }
.dataTables_wrapper .dataTables_filter input, .dataTables_wrapper .dataTables_length select {
  border: 1px solid #cdd8d4 !important; border-radius: 8px !important; padding: .4rem .7rem !important; background: #fff; margin-left: .5em; outline: none;
}
.dataTables_wrapper .dataTables_filter input:focus { border-color: var(--ath-teal) !important; box-shadow: 0 0 0 4px rgba(15, 122, 115, .14); }
.dataTables_wrapper .dataTables_info { color: var(--ath-muted) !important; padding-top: 14px !important; }
.dataTables_wrapper .dataTables_paginate { padding-top: 10px !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button {
  border: 1px solid transparent !important; border-radius: 8px !important; padding: .35em .8em !important; margin: 0 2px !important;
  color: var(--ath-ink) !important; background: transparent !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--ath-line-soft) !important; color: var(--ath-ink) !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.current, .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover { background: var(--ath-blue) !important; border-color: var(--ath-blue) !important; color: #fff !important; }
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled { color: #a6b3bd !important; }
.dataTables_wrapper .dt-buttons { margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.dataTables_wrapper .dt-button, div.dt-button-collection .dt-button {
  background: #fff !important; border: 1px solid #c6d3cf !important; border-radius: 8px !important; color: var(--ath-ink) !important;
  padding: .4rem .85rem !important; margin: 0 !important; font-size: 13px !important; font-weight: 600; box-shadow: none !important;
}
.dataTables_wrapper .dt-button:hover { background: #f2f5f4 !important; border-color: #aebfba !important; }
.dataTables_processing { border-radius: 10px !important; box-shadow: var(--ath-shadow); border: 1px solid var(--ath-line) !important; background: #fff !important; color: var(--ath-ink); }
@media (max-width: 767.98px) {
  .dataTables_wrapper .dataTables_filter, .dataTables_wrapper .dataTables_length, .dataTables_wrapper .dataTables_info, .dataTables_wrapper .dataTables_paginate { float: none !important; text-align: left !important; }
  .dataTables_wrapper .dataTables_filter input { width: 100%; margin: 6px 0 0 !important; }
  .dataTables_wrapper .dataTables_filter label { display: block; width: 100%; }
}

/* Badge status di tabel */
.badge { font-weight: 600; border-radius: 99px; padding: .35em .7em; }

/* ---------------------------------------------------------------------
   Modal
   --------------------------------------------------------------------- */
.modal-backdrop.show { opacity: .45; }
.modal-content { border: 0; border-radius: var(--ath-radius-lg); box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .45); overflow: hidden; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--ath-line-soft); background: #fff; }
.modal-title, .modal-title.fs-5 { font-size: 17px !important; font-weight: 800; letter-spacing: -.01em; color: var(--ath-ink); }
.modal-title b { font-weight: 800; }
.modal-body { padding: 20px 22px; background: #fff; }
.modal-body.modal-layout { background: #fff; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--ath-line-soft); background: #f8faf9; gap: 8px; }
.modal-footer > * { margin: 0; }
.modal-body > .row[style*="float"] { float: none !important; display: flex; justify-content: flex-end; margin: 12px 0 0 !important; }
.modal-body > .row[style*="float"] > div { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 0; }
.modal-body > .row[style*="float"] .btn { margin: 0 !important; }
@media (max-width: 575.98px) { .modal-body, .modal-header, .modal-footer { padding-left: 16px; padding-right: 16px; } }

.label-statement-faith { display: block; padding: 16px 18px; background: #f8faf9; border: 1px solid var(--ath-line); border-radius: var(--ath-radius); font-size: 14px; line-height: 1.75; color: var(--ath-ink) !important; font-weight: 400; max-width: 75ch; }

/* Daftar hasil pencarian karyawan */
.row-list .list-group { border-radius: var(--ath-radius); max-height: 260px; overflow: auto; }
.row-list .list-group-item { cursor: pointer; font-size: 14px; border-color: var(--ath-line-soft); }
.row-list .list-group-item:hover { background: #f1f5f4; }

/* ---------------------------------------------------------------------
   Alert
   --------------------------------------------------------------------- */
.alert { border-radius: var(--ath-radius); padding: 12px 16px; font-size: 14px; border: 1px solid transparent; }
.alert-danger { background: #fdf0ef; border-color: #f4cdca; color: #8f251f; }
.alert-success { background: #ecf7ee; border-color: #c7e6cc; color: #1c6a29; }
.alert-info { background: var(--ath-tint); border-color: #cfe0ee; color: #1d4466; }
.alert-warning { background: #fff7e6; border-color: #f5dca6; color: #7a5300; }

/* ---------------------------------------------------------------------
   Sejarah rekrutmen (accordion -> timeline)
   --------------------------------------------------------------------- */
.history-timeline .accordion { --bs-accordion-border-color: transparent; --bs-accordion-bg: transparent; position: relative; padding-left: 22px; }
.history-timeline .accordion::before { content: ""; position: absolute; left: 7px; top: 22px; bottom: 22px; width: 2px; background: var(--ath-line); border-radius: 2px; }
.history-timeline .accordion-item { position: relative; border: 1px solid var(--ath-line) !important; border-radius: var(--ath-radius) !important; margin-bottom: 10px; background: #fff; overflow: visible; }
.history-timeline .accordion-item::before {
  content: ""; position: absolute; left: -22px; top: 19px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid #c3d0cc; z-index: 1;
}
.history-timeline .accordion-item.is-done::before { background: var(--ath-green); border-color: var(--ath-green); box-shadow: 0 0 0 3px #dff1e2; }
.history-timeline .accordion-button { border-radius: var(--ath-radius) !important; font-size: 14.5px; padding: 14px 16px; color: var(--ath-ink); background: #fff; gap: 10px; }
.history-timeline .accordion-button b { font-weight: 700; }
.history-timeline .accordion-button:not(.collapsed) { background: #f6faf8; color: var(--ath-ink); box-shadow: inset 0 -1px 0 var(--ath-line-soft); border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.history-timeline .accordion-button:focus { box-shadow: 0 0 0 4px rgba(15, 122, 115, .14); }
.history-timeline .accordion-button::after { margin-left: 12px; flex: none; }
.history-timeline .accordion-body { font-size: 14px; padding: 16px 18px; line-height: 1.7; }
.history-timeline .accordion-body ul { padding-left: 1.2rem; margin-bottom: .4rem; }
.history-timeline .accordion-body > ul { padding-left: 0; list-style: none; }
.history-timeline .accordion-body > ul > b { display: block; color: var(--ath-blue); margin-bottom: 4px; }
.history-timeline .accordion-body hr { border-color: var(--ath-line); opacity: 1; margin: 14px 0; }
.process-checked { color: var(--ath-green); font-size: 16px; }
.history-timeline .state-pill { margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 99px; background: var(--ath-line-soft); color: var(--ath-muted); white-space: nowrap; }
.history-timeline .is-done .state-pill { background: #e3f3e6; color: #1c6a29; }
.button-note-file { font-weight: 600; }

/* ---------------------------------------------------------------------
   Dashboard admin
   --------------------------------------------------------------------- */
.filter-grid { display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(170px, 1fr) minmax(170px, 1fr) auto; gap: 14px; align-items: end; }
.filter-grid .mb-2, .filter-grid .mb-3 { margin-bottom: 0 !important; }
@media (max-width: 991.98px) { .filter-grid { grid-template-columns: 1fr 1fr; } .filter-grid > :first-child, .filter-grid > :last-child { grid-column: 1 / -1; } }
@media (max-width: 575.98px) { .filter-grid { grid-template-columns: 1fr; } .filter-grid .btn { width: 100%; } }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 12.5px; color: var(--ath-muted); }

/* ---------------------------------------------------------------------
   jQuery UI datepicker
   --------------------------------------------------------------------- */
.input-group { flex-wrap: nowrap; }
.input-group > .form-control.hasDatepicker { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ui-datepicker-trigger {
  border: 1px solid var(--ath-blue); background: var(--ath-blue); color: #fff; width: 46px; flex: none;
  border-radius: 0 var(--ath-radius-sm) var(--ath-radius-sm) 0; margin-left: -1px; cursor: pointer;
}
.ui-datepicker-trigger:hover { background: var(--ath-blue-600); }
.ui-datepicker { font-family: var(--bs-body-font-family) !important; border: 1px solid var(--ath-line) !important; border-radius: 14px !important; padding: 10px !important; box-shadow: var(--ath-shadow); background: #fff !important; z-index: 1100 !important; width: 19em; }
.ui-datepicker .ui-datepicker-header { background: #fff !important; border: 0 !important; color: var(--ath-ink); font-weight: 700; padding: .4em 0; }
.ui-datepicker .ui-datepicker-title select { border: 1px solid var(--ath-line); border-radius: 6px; padding: 2px 4px; font-size: 13px; margin: 0 2px; }
.ui-datepicker th { color: var(--ath-muted); font-weight: 600; font-size: 12px; }
.ui-datepicker td a.ui-state-default, .ui-datepicker td span.ui-state-default { border: 0 !important; background: transparent !important; text-align: center; border-radius: 8px; padding: .4em .2em; color: var(--ath-ink); }
.ui-datepicker td a.ui-state-default:hover { background: var(--ath-line-soft) !important; }
.ui-datepicker td a.ui-state-highlight { background: var(--ath-tint) !important; color: var(--ath-blue) !important; font-weight: 700; }
.ui-datepicker td a.ui-state-active { background: var(--ath-blue) !important; color: #fff !important; }
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { top: 6px !important; border: 0 !important; background: transparent !important; cursor: pointer; }
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { background: var(--ath-line-soft) !important; border-radius: 8px; }

/* ---------------------------------------------------------------------
   SweetAlert
   --------------------------------------------------------------------- */
.swal-overlay { background-color: rgba(16, 38, 58, .45); }
.swal-modal { border-radius: var(--ath-radius-lg); font-family: var(--bs-body-font-family); width: min(460px, calc(100vw - 32px)); padding-top: 10px; }
.swal-title { color: var(--ath-ink); font-size: 20px; font-weight: 800; letter-spacing: -.01em; padding: 10px 20px 0; }
.swal-text { color: var(--ath-muted); text-align: center; font-size: 15px; line-height: 1.6; padding: 0 22px; }
.swal-footer { text-align: center; padding: 14px 20px 20px; margin-top: 12px; }
.swal-button { border-radius: 10px; font-weight: 600; font-size: 14px; padding: 10px 22px; background-color: var(--ath-blue); }
.swal-button:not([disabled]):hover { background-color: var(--ath-blue-600); }
.swal-button:focus { box-shadow: 0 0 0 4px rgba(0, 69, 124, .2); }
.swal-button--cancel { background: #fff; color: var(--ath-ink); border: 1px solid #c6d3cf; }
.swal-button--cancel:not([disabled]):hover { background: #f2f5f4; }
.swal-button--danger { background-color: var(--ath-danger); }
.swal-button--danger:not([disabled]):hover { background-color: #a92c26; }

/* ---------------------------------------------------------------------
   Utilitas kecil & kompatibilitas class lama
   --------------------------------------------------------------------- */
.text-red { color: var(--ath-danger) !important; }
.text-link { color: var(--ath-blue) !important; }
.bg-blue { background: var(--ath-blue); color: #fff; }
.right-pos { text-align: right; }
.img-section { display: none; }
@media (max-width: 575.98px) {
  body { font-size: 14.5px; }
  .img-ktp { width: 100%; height: auto; aspect-ratio: 85.6 / 54; }
  .row > [class*="col-"] { margin-bottom: 2px; }
}
@media print {
  .app-topbar, .form-toc, .app-footer, #app-progress, .loading { display: none !important; }
  .form-shell { display: block; }
  .form-section { box-shadow: none; break-inside: avoid-page; }
}

/* Select lama yang memakai class form-control */
select.form-control {
  appearance: none; -webkit-appearance: none; padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2315324d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right .8rem center; background-size: 14px 10px;
}
.row > .form-check { margin-left: calc(var(--bs-gutter-x) * .5); width: auto; }
.position-list .row > .form-check { margin-left: 0; width: 100%; }

/* Input file berbahasa Indonesia */
.file-field { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 5px; border: 1px solid #cdd8d4; border-radius: var(--ath-radius-sm); background: #fff; transition: border-color .15s, box-shadow .15s; }
.file-field:hover { border-color: var(--ath-teal); }
.file-field:focus-within { border-color: var(--ath-teal); box-shadow: 0 0 0 4px rgba(15, 122, 115, .14); }
.file-field.is-invalid { border-color: var(--ath-danger); }
.file-field input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.file-field .file-btn { flex: none; display: inline-flex; align-items: center; gap: 6px; background: var(--ath-tint); color: var(--ath-blue); font-weight: 600; font-size: 13.5px; padding: .4rem .8rem; border-radius: 6px; }
.file-field .file-name { font-size: 14px; color: var(--ath-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-field.has-file .file-name { color: var(--ath-ink); font-weight: 500; }

/* Status lamaran di tabel daftar pelamar */
.status-badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.status-badge.is-proses { background: var(--ath-tint); color: var(--ath-blue); }
.status-badge.is-diterima { background: #e3f3e6; color: #1c6a29; }
.status-badge.is-tidak { background: #fdecea; color: #8f251f; }

/* ---------------------------------------------------------------------
   Aplikasi pelamar — tampilan desktop (>= 1200px) selebar layar.
   Tampilan HP & tablet tidak berubah.
   --------------------------------------------------------------------- */
@media (min-width: 1200px) {
  .layout-wide .app-container { max-width: none; padding-left: 40px; padding-right: 40px; }

  .layout-wide .hero-media { padding: 10px; }
  .layout-wide .hero-media .carousel-control-prev, .layout-wide .hero-media .carousel-control-next { width: 64px; }
  .layout-wide .hero-media .carousel-control-prev-icon, .layout-wide .hero-media .carousel-control-next-icon { width: 38px; height: 38px; }

  .layout-wide .form-shell { grid-template-columns: 270px minmax(0, 1fr); gap: 32px; }
}

/* Judul dan banner masing-masing satu baris mulai layar laptop (>= 992px) */
@media (min-width: 992px) {
  .layout-wide .hero { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .layout-wide .hero h1 { margin-bottom: 10px; }
  .layout-wide .hero .lead { max-width: none; }
}

/* ---------------------------------------------------------------------
   Menu utama di topbar (aplikasi admin)
   --------------------------------------------------------------------- */
.app-nav { display: flex; align-items: center; gap: 4px; margin-left: 20px; height: 100%; }
.app-nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px;
  color: var(--ath-muted); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
}
.app-nav-link:hover { color: var(--ath-ink); background: var(--ath-line-soft); }
.app-nav-link.is-active { color: var(--ath-blue); background: var(--ath-tint); }
@media (max-width: 767.98px) {
  .app-brand .brand-sub { display: none; }
  .app-nav { margin-left: 8px; }
  .app-nav-link { padding: 0 10px; }
}
@media (max-width: 575.98px) {
  .app-nav-link span { display: none; }
  .app-nav-link { width: 40px; justify-content: center; padding: 0; }
  .app-nav-link i { font-size: 16px; }
}

/* ---------------------------------------------------------------------
   Halaman Manual Book (penampil PDF)
   --------------------------------------------------------------------- */
.manual-viewer { background: #fff; border: 1px solid var(--ath-line); border-radius: var(--ath-radius-lg); box-shadow: var(--ath-shadow); overflow: clip; }
.manual-toolbar {
  position: sticky; top: var(--topbar-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 16px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--ath-line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.manual-toolbar .file-info { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 260px; }
.manual-toolbar .file-icon { flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: #fdecea; color: var(--ath-danger); font-size: 18px; }
.manual-toolbar .file-name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manual-toolbar .file-meta { font-size: 12.5px; color: var(--ath-muted); }
.manual-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.manual-controls .btn { min-width: 0; padding: .45rem .7rem; }
.manual-controls .zoom-label { min-width: 52px; text-align: center; font-size: 13px; font-weight: 600; color: var(--ath-muted); }
.manual-controls .page-label { font-size: 13px; color: var(--ath-muted); padding: 0 6px; white-space: nowrap; }
.manual-pages { background: #e9eeec; padding: 20px 12px 28px; min-height: 60vh; overflow-x: auto; }
.manual-pages canvas { display: block; margin: 0 auto 16px; background: #fff; box-shadow: 0 2px 10px rgba(21, 50, 77, .18); border-radius: 2px; max-width: none; }
.manual-loading { text-align: center; color: var(--ath-muted); padding: 60px 16px; font-size: 14px; }
.manual-empty { text-align: center; padding: 56px 20px; }
.manual-empty .icon { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 16px; background: var(--ath-tint); color: var(--ath-blue); font-size: 26px; }
.manual-empty h2 { font-size: 19px; font-weight: 800; margin-bottom: 6px; }
.manual-empty p { color: var(--ath-muted); max-width: 52ch; margin: 0 auto; }
.manual-empty code { background: var(--ath-line-soft); padding: 2px 6px; border-radius: 6px; color: var(--ath-ink); }
@media (max-width: 575.98px) {
  .manual-pages { padding: 12px 6px 20px; }
  .manual-toolbar { padding: 10px 12px; gap: 8px; }
  .manual-controls { width: 100%; flex-wrap: nowrap; gap: 4px; }
  .manual-controls .page-label { margin-right: auto; padding: 0; font-size: 12px; }
  .manual-controls .zoom-label { min-width: 40px; font-size: 12px; }
  .manual-controls .btn { padding: .4rem .55rem; }
  .manual-controls .btn-text { display: none; }
}

/* ---------------------------------------------------------------------
   Formulir pelamar: panel draf otomatis & status unggah foto
   --------------------------------------------------------------------- */
.draft-panel { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #cfe3dc; border-radius: var(--ath-radius-sm); background: #eef7f3; color: var(--ath-ink); font-size: 14px; }
.draft-panel .draft-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff; color: var(--ath-teal); }
.draft-panel .draft-text { flex: 1 1 260px; min-width: 0; line-height: 1.5; }
.draft-panel .draft-text span { color: var(--ath-muted); }
.draft-panel .draft-link-btn { flex: none; white-space: nowrap; }
.upload-status { margin-top: 6px; font-size: 13px; line-height: 1.45; }
.upload-status:empty { display: none; }
.upload-status.is-uploading { color: var(--ath-blue); }
.upload-status.is-done { color: var(--ath-green); }
.upload-status.is-error { color: var(--ath-danger); }
.upload-status .upload-retry { font-weight: 600; text-decoration: underline; }
@media (max-width: 575.98px) { .draft-panel .draft-link-btn { width: 100%; } }
