/* ================================================================
   SIPEG – Yayasan Insan Cendikia Jayapura
   Style Sheet v1.0.0
   ================================================================ */

:root {
  --navy:        #0d2137;
  --navy-mid:    #163352;
  --navy-light:  #1e4976;
  --gold:        #c9a84c;
  --gold-light:  #e8c97a;
  --gold-pale:   #fdf5e0;
  --cream:       #f7f4ef;
  --white:       #ffffff;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-400:    #9ca3af;
  --gray-500:    #6b7280;
  --gray-600:    #4b5563;
  --gray-800:    #1f2937;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --green:       #15803d;
  --green-light: #dcfce7;
  --blue:        #1d4ed8;
  --blue-light:  #dbeafe;
  --orange:      #c2410c;
  --orange-light:#ffedd5;

  --sidebar-w: 260px;
  --radius:    10px;
  --shadow:    0 2px 16px rgba(13,33,55,.10);
  --shadow-md: 0 8px 32px rgba(13,33,55,.14);
  --transition: .18s ease;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--gray-800); min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4,h5 { font-family: 'Playfair Display', serif; color: var(--navy); line-height: 1.3; }
button, input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ── LAYOUT ── */
.layout { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 200;
  overflow-y: auto;
  transition: transform var(--transition);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.s-emblem {
  width: 42px; height: 42px;
  background: var(--gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.sidebar-brand h3 { font-size: .95rem; color: var(--white); }
.sidebar-brand span { font-size: .68rem; color: rgba(255,255,255,.45); font-family: 'DM Sans', sans-serif; font-weight: 300; }
.sidebar-nav { padding: 14px 10px; flex: 1; }
.nav-section {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
  text-transform: uppercase;
  padding: 12px 10px 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition);
  font-size: .85rem;
  color: rgba(255,255,255,.72);
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-item.active { background: rgba(201,168,76,.18); color: var(--gold-light); }
.nav-item .ni { width: 18px; text-align: center; font-size: .9rem; }
.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.admin-info { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.admin-avatar {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .88rem;
  color: var(--navy);
  flex-shrink: 0;
}
.admin-info > div > p { font-size: .82rem; font-weight: 600; color: var(--white); }
.admin-info > div > span { font-size: .7rem; color: rgba(255,255,255,.4); }
.btn-logout {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  background: rgba(220,38,38,.15);
  border: none;
  color: #fca5a5;
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: .78rem;
  width: 100%;
  transition: background var(--transition);
}
.btn-logout:hover { background: rgba(220,38,38,.28); }

/* ── MAIN ── */
.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-height: 100vh; }
.topbar {
  background: var(--white);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.sidebar-toggle {
  display: none;
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer; color: var(--gray-600);
  padding: 4px 8px; border-radius: 6px;
}
.topbar h2 { font-size: 1.1rem; }
.topbar span { font-size: .75rem; color: var(--gray-400); display: block; margin-top: 1px; font-family: 'DM Sans', sans-serif; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.org-badge {
  font-size: .75rem; font-weight: 600;
  color: var(--navy);
  background: var(--gold-pale);
  border: 1px solid var(--gold);
  border-radius: 100px;
  padding: 3px 12px;
}
.version-badge {
  font-size: .72rem; font-weight: 600;
  color: var(--gray-500);
  background: var(--gray-100);
  border-radius: 100px;
  padding: 3px 10px;
}
.content { padding: 24px 28px; flex: 1; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: .83rem; font-weight: 600;
  cursor: pointer; border: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary   { background: var(--navy);       color: var(--white); }
.btn-primary:hover { background: var(--navy-light); }
.btn-gold      { background: var(--gold);        color: var(--navy); }
.btn-gold:hover { background: var(--gold-light); }
.btn-outline   { background: transparent; color: var(--navy); border: 1.5px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--navy); background: var(--gray-50); }
.btn-danger    { background: var(--red-light);   color: var(--red); }
.btn-danger:hover { background: var(--red);      color: var(--white); }
.btn-success   { background: var(--green-light); color: var(--green); }
.btn-sm { padding: 5px 12px; font-size: .76rem; border-radius: 6px; }
.btn-xs { padding: 3px 9px;  font-size: .72rem; border-radius: 5px; }

/* ── CARD ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 22px;
  overflow: hidden;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.card-header h3 { font-size: .97rem; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-body { padding: 22px; }

/* ── STAT CARDS ── */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  border-left: 4px solid var(--gold);
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.si-blue   { background: var(--blue-light); }
.si-green  { background: var(--green-light); }
.si-gold   { background: var(--gold-pale); }
.si-red    { background: var(--red-light); }
.si-orange { background: var(--orange-light); }
.stat-card p { font-size: .75rem; color: var(--gray-400); margin-bottom: 2px; font-weight: 500; }
.stat-card h3 { font-size: 1.55rem; }

/* ── WELCOME BANNER ── */
.welcome-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: 14px;
  padding: 26px 30px;
  margin-bottom: 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.welcome-banner h2 { color: var(--white); font-size: 1.45rem; margin-bottom: 4px; }
.welcome-banner p  { font-size: .82rem; color: rgba(255,255,255,.65); font-family: 'DM Sans'; }
.welcome-banner .wb-icon { font-size: 3.5rem; opacity: .25; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; }
thead th {
  background: var(--gray-50);
  color: var(--gray-500);
  font-weight: 600;
  font-size: .73rem;
  letter-spacing: .3px;
  text-transform: uppercase;
  padding: 10px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--gray-200);
}
tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
  color: var(--gray-800);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--gold-pale); }
.emp-photo {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}
.emp-photo-ph {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-weight: 700; font-size: .85rem;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}
.td-actions { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── BADGE ── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .73rem; font-weight: 600;
}
.badge-tetap   { background: var(--green-light); color: var(--green); }
.badge-kontrak { background: #fef3c7;            color: #92400e; }
.badge-blue    { background: var(--blue-light);  color: var(--blue); }
.badge-gold    { background: var(--gold-pale);   color: #7a5c00; }
.badge-red     { background: var(--red-light);   color: var(--red); }

/* ── SEARCH BOX ── */
.search-box {
  display: flex; align-items: center; gap: 6px;
  background: var(--gray-100);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 7px 14px;
  transition: border-color var(--transition);
}
.search-box:focus-within { border-color: var(--gold); background: var(--white); }
.search-box input { border: none; background: transparent; outline: none; font-size: .85rem; width: 200px; }

/* ── FORM ── */
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-pale);
  display: flex; align-items: center; gap: 8px;
}
.form-grid   { display: grid; grid-template-columns: 1fr 1fr;     gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.form-full   { grid-column: 1 / -1; }
.f-group { display: flex; flex-direction: column; gap: 4px; }
.f-group label { font-size: .78rem; font-weight: 600; color: var(--gray-600); }
.f-group input,
.f-group select,
.f-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  font-size: .86rem;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}
.f-group input:focus,
.f-group select:focus,
.f-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,76,.12);
}
.f-group textarea { resize: vertical; min-height: 72px; }
.f-hint { font-size: .72rem; color: var(--gray-400); margin-top: 2px; }
.f-required { color: var(--red); margin-left: 2px; }

/* ── PHOTO UPLOAD ── */
.photo-upload-box {
  display: flex; align-items: center; gap: 20px;
  background: var(--gray-50);
  border: 2px dashed var(--gray-200);
  border-radius: 10px;
  padding: 18px 20px;
}
.photo-upload-box:hover { border-color: var(--gold); }
.photo-preview {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
  flex-shrink: 0;
}
.photo-preview-ph {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--navy);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; color: var(--gold);
  border: 3px solid var(--gold);
  flex-shrink: 0;
}

/* ── DYNAMIC LIST ── */
.dynamic-list { display: flex; flex-direction: column; gap: 8px; }
.dynamic-item { display: flex; gap: 8px; align-items: center; }
.dynamic-item input { flex: 1; }
.btn-add-dyn {
  display: flex; align-items: center; gap: 6px;
  background: var(--gold-pale);
  color: var(--navy);
  border: 1.5px dashed var(--gold);
  border-radius: 7px;
  padding: 7px 14px;
  cursor: pointer;
  font-size: .8rem; font-weight: 600;
  transition: background var(--transition);
  margin-top: 8px;
}
.btn-add-dyn:hover { background: var(--gold); color: var(--white); }
.btn-remove-item {
  background: var(--red-light); border: none;
  border-radius: 6px;
  width: 28px; height: 28px;
  cursor: pointer;
  color: var(--red);
  font-size: .9rem;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.btn-remove-item:hover { background: var(--red); color: var(--white); }
.sub-form-block {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

/* ── DETAIL VIEW ── */
.detail-hero {
  display: flex; align-items: center; gap: 22px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  border-radius: 14px;
  padding: 26px 28px;
  margin-bottom: 22px;
  color: var(--white);
}
.detail-hero-photo {
  width: 88px; height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--gold);
  flex-shrink: 0;
}
.detail-hero-ph {
  width: 88px; height: 88px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem;
  color: var(--gold);
  border: 4px solid var(--gold);
  flex-shrink: 0;
}
.detail-hero-info h2 { color: var(--white); font-size: 1.5rem; margin-bottom: 4px; }
.detail-hero-info p  { font-size: .82rem; opacity: .75; margin-bottom: 8px; }
.detail-hero-actions { margin-left: auto; display: flex; gap: 8px; }
.detail-tabs {
  display: flex; gap: 4px;
  background: var(--gray-100);
  border-radius: 10px; padding: 4px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.dtab {
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-size: .82rem; font-weight: 600;
  color: var(--gray-500);
  border: none; background: transparent;
  transition: all var(--transition);
}
.dtab.active {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.dtab-panel { display: none; }
.dtab-panel.active { display: block; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.detail-item {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 11px 14px;
}
.detail-item label {
  font-size: .7rem; font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase; letter-spacing: .3px;
  display: block; margin-bottom: 3px;
}
.detail-item p { font-size: .88rem; color: var(--gray-800); font-weight: 500; }
.detail-full { grid-column: 1 / -1; }
.section-sub {
  font-size: .73rem; font-weight: 700;
  color: var(--navy); text-transform: uppercase; letter-spacing: .5px;
  margin: 16px 0 8px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--gray-200);
}
.list-pill {
  display: inline-flex; align-items: center;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: .78rem; font-weight: 600;
  margin: 3px;
}

/* ── PELATIHAN & KINERJA CARDS ── */
.pelatihan-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.pelatihan-card h4 { font-size: .88rem; margin-bottom: 4px; }
.pelatihan-card p  { font-size: .78rem; color: var(--gray-400); }
.kinerja-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 11px 14px;
  margin-bottom: 8px;
}
.kinerja-score {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem; flex-shrink: 0;
}

/* ── PAGINATION ── */
.pagination {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 22px;
  border-top: 1px solid var(--gray-200);
  flex-wrap: wrap;
}
.page-info { font-size: .8rem; color: var(--gray-400); margin-left: auto; }

/* ── EMPTY STATE ── */
.no-data {
  text-align: center;
  padding: 36px;
  color: var(--gray-400);
}
.no-data span { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.no-data p { font-size: .85rem; }

/* ── ALERT ── */
.alert {
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .84rem;
  margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--green-light); color: var(--green); border: 1px solid #bbf7d0; }
.alert-error   { background: var(--red-light);   color: var(--red);   border: 1px solid #fecaca; }
.alert-warning { background: var(--orange-light); color: var(--orange); border: 1px solid #fed7aa; }
.alert-info    { background: var(--blue-light);  color: var(--blue);  border: 1px solid #bfdbfe; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px; right: 24px;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: .85rem; font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 9999;
  animation: toastIn .25s ease;
  transition: opacity .5s;
  display: flex; align-items: center; gap: 8px;
}
.toast-success { background: var(--green); color: var(--white); }
.toast-error   { background: var(--red);   color: var(--white); }
@keyframes toastIn { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: none; } }

/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 70%, #2a6496 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: rgba(201,168,76,.06);
  top: -150px; right: -150px;
}
.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 44px 40px;
  width: 420px; max-width: 95vw;
  box-shadow: 0 32px 80px rgba(0,0,0,.3);
  position: relative; z-index: 2;
}
.login-logo { text-align: center; margin-bottom: 26px; }
.login-emblem {
  width: 68px; height: 68px;
  background: var(--navy); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  font-size: 26px; color: var(--gold);
  box-shadow: 0 8px 24px rgba(13,33,55,.3);
}
.login-logo h2  { font-size: 1.25rem; color: var(--navy); margin-bottom: 2px; }
.login-logo p   { font-size: .78rem;  color: var(--gray-400); }
.login-title    { font-size: 1.45rem; text-align: center; margin-bottom: 6px; }
.login-sub      { text-align: center; font-size: .82rem; color: var(--gray-400); margin-bottom: 26px; }
.login-error    {
  background: var(--red-light); color: var(--red);
  border-radius: 7px; padding: 10px 14px;
  font-size: .82rem; text-align: center;
  margin-bottom: 14px;
}
.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--navy), var(--navy-light));
  color: var(--white); border: none; border-radius: 8px;
  font-size: .95rem; font-weight: 600; cursor: pointer;
  transition: opacity var(--transition), transform .1s;
  margin-top: 4px;
}
.btn-login:hover  { opacity: .9; }
.btn-login:active { transform: scale(.99); }

/* ── MIGRATION STATUS TABLE ── */
.mig-ran     { color: var(--green);  font-weight: 600; }
.mig-pending { color: var(--orange); font-weight: 600; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .sidebar-toggle { display: block; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .content { padding: 16px; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .detail-tabs { flex-direction: column; }
  .dtab { width: 100%; }
}

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .card-actions, .btn, .detail-tabs,
  .dtab, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .dtab-panel { display: block !important; }
  .detail-hero { background: var(--navy) !important; -webkit-print-color-adjust: exact; }
}
