/* =====================================================================
   GENETHINK — Base styles: tokens, reset, typography, shared components
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Manrope:wght@400;500;600;700&display=swap');

:root {
  /* Palette inti sesuai brief */
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --secondary: #2563EB;
  --purple: #7C3AED;
  --dark: #172554;
  --bg: #F7F8FF;
  --card: #FFFFFF;

  /* Turunan */
  --primary-50: #EEF0FF;
  --primary-100: #E0E3FF;
  --gradient-brand: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 55%, var(--purple) 100%);
  --gradient-soft: linear-gradient(160deg, #EEF1FF 0%, #F7F8FF 55%, #F3EEFF 100%);

  --text-primary: #14163A;
  --text-secondary: #565B82;
  --text-muted: #8A8FB3;
  --border: #E7E8F5;
  --border-strong: #D6D8F0;

  --success: #16A34A;
  --success-bg: #E9F9EF;
  --danger: #DC2626;
  --danger-bg: #FDECEC;
  --warning: #D97706;
  --warning-bg: #FEF3E2;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(23, 37, 84, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(31, 41, 111, 0.14);
  --shadow-lg: 0 20px 45px -12px rgba(31, 41, 111, 0.22);

  --font-display: 'Plus Jakarta Sans', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Manrope', 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --sidebar-width: 264px;
  --topbar-height: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 0 0 .5em;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
p { margin: 0 0 1em; color: var(--text-secondary); }

:focus-visible {
  outline: 2.5px solid var(--secondary);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

.icon { width: 20px; height: 20px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }
.icon-xl { width: 40px; height: 40px; }

/* ---------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 1.5px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 10px 24px -8px rgba(79, 70, 229, .55);
}
.btn-primary:hover { box-shadow: 0 14px 30px -8px rgba(79, 70, 229, .65); filter: brightness(1.03); }
.btn-outline {
  background: #fff;
  color: var(--primary);
  border-color: var(--border-strong);
}
.btn-outline:hover { border-color: var(--primary); background: var(--primary-50); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--primary-50); color: var(--primary); }
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
}
.btn-danger:hover { background: #fbdada; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; border-radius: var(--radius-pill); }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; border-radius: var(--radius-sm); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------------------------------------------------------------
   BADGES
   --------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-muted { background: #EEF0F8; color: var(--text-muted); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-primary { background: var(--primary-50); color: var(--primary); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }

/* ---------------------------------------------------------------
   CARDS
   --------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }

/* ---------------------------------------------------------------
   FORMS
   --------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--text-primary);
  margin-bottom: 7px;
}
.form-label .optional { color: var(--text-muted); font-weight: 500; }
.form-control,
select.form-control,
textarea.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.92rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 4px var(--primary-50);
  outline: none;
}
textarea.form-control { resize: vertical; min-height: 110px; }
.form-hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 0.8rem; color: var(--danger); margin-top: 6px; font-weight: 600; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.input-icon-wrap .form-control { padding-left: 42px; }
.checkbox-row { display: flex; align-items: center; gap: 9px; font-size: 0.88rem; color: var(--text-secondary); }
.file-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: var(--primary-50);
}

/* ---------------------------------------------------------------
   ALERTS / FLASH
   --------------------------------------------------------------- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 18px;
}
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error { background: var(--danger-bg); color: var(--danger); }
.alert .icon { margin-top: 1px; }

/* ---------------------------------------------------------------
   TABLES
   --------------------------------------------------------------- */
.table-responsive { overflow-x: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
table.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; background: #fff; }
table.table th {
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: #FAFAFF;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
table.table tr:last-child td { border-bottom: none; }
table.table tr:hover td { background: #FBFBFF; }
.table-actions { display: flex; gap: 6px; }

/* ---------------------------------------------------------------
   PROGRESS BAR
   --------------------------------------------------------------- */
.progress-track {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-100);
  overflow: hidden;
}
.progress-track.sm { height: 6px; }
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
}

/* ---------------------------------------------------------------
   EMPTY STATE
   --------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state .icon-xl { margin: 0 auto 14px; color: var(--border-strong); width: 52px; height: 52px; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 6px; }

/* ---------------------------------------------------------------
   PAGINATION
   --------------------------------------------------------------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.pagination a:hover { border-color: var(--secondary); color: var(--secondary); }
.pagination .active { background: var(--gradient-brand); color: #fff; border-color: transparent; }

/* ---------------------------------------------------------------
   UTILITIES
   --------------------------------------------------------------- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-0{margin-top:0} .mb-0{margin-bottom:0}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem;
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.3rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
}
