/**
 * style.css
 * Token desain & komponen kecil yang tidak praktis dibuat lewat utility class Tailwind
 * saja (font pairing, animasi toast, spinner, scrollbar, sidebar active state).
 */

:root {
  --color-bg: #FAFAFA;
  --color-sidebar: #09090B;
  --color-sidebar-hover: #F4F4F5;
  --color-accent: #18181B;
  --color-accent-dark: #18181B;
}

* {
  font-family: 'Inter', system-ui, sans-serif;
}

.font-display {
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  background-color: var(--color-bg);
}

/* ---------- Sidebar ---------- */
#sidebar {
  background: #ffffff;
  border-right: 1px solid #E4E4E7;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  color: #52525B;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover {
  background-color: #F4F4F5;
  color: #18181B;
}
.sidebar-item.nav-active {
  background: #18181B;
  color: #fff;
  font-weight: 600;
  border-radius: 0.5rem;
}
.sidebar-stage {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  color: #A1A1AA;
  width: 1.35rem;
  height: 1.35rem;
  border: 1px solid #E4E4E7;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-item.nav-active .sidebar-stage {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.sidebar-section-title {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #A1A1AA;
  padding: 0.75rem 0.75rem 0.25rem;
}
.sidebar-section-title:first-child {
  padding-top: 0.25rem;
}

/* ---------- Sidebar Profile Card ---------- */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #F4F4F5;
  border-radius: 0.5rem;
  border: 1px solid #E4E4E7;
}
.sidebar-profile-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background: #18181B;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-profile-name {
  color: #18181B;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}
.sidebar-profile-role {
  color: #71717A;
  font-size: 0.7rem;
  line-height: 1.2;
}

/* ---------- Donut Chart ---------- */
.donut-chart {
  width: 10rem;
  height: 10rem;
  border-radius: 50%;
  position: relative;
  margin: 0 auto;
}
.donut-chart-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #6B7280;
}
.donut-legend-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------- Empty State ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  text-align: center;
  color: #9CA3AF;
}
.empty-state-icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}
.empty-state-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #6B7280;
  margin-bottom: 0.25rem;
}
.empty-state-desc {
  font-size: 0.75rem;
  color: #9CA3AF;
}

/* ---------- Spinner ---------- */
.spinner-sm {
  display: inline-block;
  width: 0.9rem;
  height: 0.9rem;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}
.spinner-dark {
  border: 2px solid rgba(20, 33, 61, 0.15);
  border-top-color: var(--color-sidebar);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Toast ---------- */
#toastContainer {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  animation: toast-in 0.2s ease-out;
}
.toast-out {
  animation: toast-out 0.25s ease-in forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(20px); }
}

/* ---------- Scrollbar (tabel) ---------- */
.table-scroll::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background-color: #D4D4D8;
  border-radius: 999px;
}

/* ---------- Modal backdrop ---------- */
.modal-backdrop {
  background-color: rgba(9, 9, 11, 0.45);
  backdrop-filter: blur(2px);
}

/* ---------- Tabel Candidates (halaman Pelamar) ---------- */
/* Scoped lewat class .candidates-table (hanya dipakai di tabel ini) supaya
   TIDAK memengaruhi tabel lain (Lowongan/Interview/Users/Roles), yang tetap
   memakai layout auto seperti sebelumnya. Lebar tiap kolom diatur lewat
   <colgroup> di index.html -- table-layout:fixed di sini WAJIB ada supaya
   lebar <col> tsb benar-benar dipatuhi browser (default table-layout:auto
   mengabaikan colgroup dan menyesuaikan lebar ke isi sel). */
.candidates-table {
  table-layout: fixed;
  border-collapse: collapse;
}
.candidates-table th,
.candidates-table td {
  vertical-align: middle;
}
/* Kolom Status AI berisi <select> (mode tulis) yang lebar alaminya mengikuti
   opsi terpanjang (mis. "PENDING_REVIEW", "NOT SELECTED"). Elemen <select>
   TIDAK ikut mematuhi overflow-hidden/text-truncate milik <td> induknya
   seperti teks biasa -- browser tetap merender select selebar kontennya dan
   membuatnya "tumpah" ke luar sel (kolom berikutnya jadi terlihat
   berantakan/tabel tidak beraturan). Paksa select & badge status untuk
   tidak pernah lebih lebar dari sel tempatnya berada. */
.candidates-table td {
  min-width: 0;
  overflow: hidden;
}
.candidates-table select,
.candidates-table td > span.write-pelamar-only,
.candidates-table td > span.readonly-pelamar-only {
  max-width: 100%;
  box-sizing: border-box;
}
.candidates-table select {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
