/* ===== Custom classes ported from the source HTML ===== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  src: local('Inter');
}

body { font-family: 'Inter', system-ui, sans-serif; background: #F8F9FC; }

.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

.nav-link {
  display: flex; align-items: center; gap: 0.625rem;
  padding: 0.5rem 0.75rem; margin: 1px 0.5rem; border-radius: 0.375rem;
  color: #cbd5e1; font-size: 0.8125rem; font-weight: 500;
  transition: all 0.15s; cursor: pointer; user-select: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.25; text-decoration: none;
}
.nav-link svg, .nav-link i { flex-shrink: 0; width: 16px !important; height: 16px !important; }
.nav-link span.label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-link:hover { background: rgba(255,255,255,0.08); color: #fff; }
.nav-link.active { background: #C8A84B; color: #0F2548; font-weight: 600; box-shadow: 0 1px 4px rgba(200,168,75,0.3); }
.nav-link.active svg, .nav-link.active i { color: #0F2548; }

.nav-group-title {
  padding: 0.875rem 1rem 0.375rem; font-size: 0.6875rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: #94a3b8;
}
.sidebar-footer { padding: 0.75rem 1rem; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 0.5rem; }

.btn-sm { padding: 0.375rem 0.625rem; font-size: 0.75rem; }
.section-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1.25rem; margin-bottom: 1rem; }
.section-title { font-size: 0.95rem; font-weight: 700; color: #1B3A6B; margin-bottom: 0.75rem; padding-bottom: 0.5rem; border-bottom: 1px solid #e5e7eb; display: flex; align-items: center; gap: 0.5rem; }
.pbas-tab { padding: 0.5rem 0.75rem; font-size: 0.75rem; font-weight: 600; color: #64748b; border: 1px solid transparent; cursor: pointer; border-radius: 0.375rem 0.375rem 0 0; white-space: nowrap; }
.pbas-tab.active { color: #1B3A6B; background: #fff; border-color: #e5e7eb; border-bottom-color: #fff; position: relative; z-index: 1; }
.pbas-tab:not(.active):hover { color: #1B3A6B; background: #f8fafc; }
.item-card { border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1rem; margin-bottom: 0.75rem; background: #fafbfc; }
.item-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.field-required::after { content: ' *'; color: #dc2626; }

.module-panel { display: block; }
.module-panel.fade-in { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.badge { display: inline-flex; align-items: center; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 600; }
.stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 0.5rem; padding: 1rem; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: #F4F6FA; color: #1B3A6B; font-weight: 600; padding: 0.625rem 0.875rem; text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #e5e7eb; }
.data-table td { padding: 0.75rem 0.875rem; font-size: 0.8125rem; border-bottom: 1px solid #f1f5f9; color: #334155; }
.data-table tr:hover td { background: #fafbfd; }

.btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 0.875rem; border-radius: 0.375rem; font-size: 0.8125rem; font-weight: 500; transition: all 0.15s; cursor: pointer; border: 1px solid transparent; text-decoration: none; }
.btn-primary { background: #1B3A6B; color: #fff; }
.btn-primary:hover { background: #16315B; }
.btn-gold { background: #C8A84B; color: #0F2548; }
.btn-gold:hover { background: #B89638; }
.btn-outline { background: #fff; color: #1B3A6B; border-color: #d1d5db; }
.btn-outline:hover { border-color: #1B3A6B; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0.375rem;
  font-size: 0.8125rem; color: #1f2937; background: #fff; transition: all 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: #1B3A6B; box-shadow: 0 0 0 3px rgba(27,58,107,0.1);
}
.form-label { display: block; font-size: 0.75rem; font-weight: 600; color: #374151; margin-bottom: 0.25rem; }

.progress-step { display: flex; align-items: center; gap: 0.5rem; }
.progress-step .circle { width: 24px; height: 24px; border-radius: 50%; background: #e5e7eb; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 600; }
.progress-step.complete .circle { background: #16a34a; color: #fff; }
.progress-step.current .circle { background: #1B3A6B; color: #fff; }

.timeline-item { position: relative; padding-left: 2rem; padding-bottom: 1.25rem; border-left: 2px solid #e5e7eb; }
.timeline-item:last-child { border-left: 2px solid transparent; padding-bottom: 0; }
.timeline-dot { position: absolute; left: -7px; top: 0; width: 12px; height: 12px; border-radius: 50%; background: #1B3A6B; border: 2px solid #fff; box-shadow: 0 0 0 1px #1B3A6B; }
.timeline-dot.gold { background: #C8A84B; box-shadow: 0 0 0 1px #C8A84B; }
.timeline-dot.gray { background: #cbd5e1; box-shadow: 0 0 0 1px #cbd5e1; }

.tab-btn { padding: 0.625rem 1rem; font-size: 0.8125rem; font-weight: 500; color: #6b7280; border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.15s; background: transparent; }
.tab-btn.active { color: #1B3A6B; border-bottom-color: #C8A84B; font-weight: 600; }
.tab-btn:hover:not(.active) { color: #1B3A6B; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15,37,72,0.5); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-box { background: #fff; border-radius: 0.5rem; max-width: 720px; width: 100%; max-height: 90vh; overflow: auto; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
}

main { min-width: 0; }
main > section.module-panel { width: 100%; min-width: 0; }
.module-panel .grid > * { min-width: 0; }
.module-panel table { table-layout: auto; max-width: 100%; }
.data-table { font-size: 0.78125rem; }

.status-draft { background: #f1f5f9; color: #475569; }
.status-submitted { background: #dbeafe; color: #1e40af; }
.status-eligible { background: #dcfce7; color: #15803d; }
.status-shortlisted { background: #fef3c7; color: #a16207; }
.status-interview { background: #ede9fe; color: #6b21a8; }
.status-recommended { background: #c7f9d6; color: #065f46; }
.status-offered { background: #fce7f3; color: #9d174d; }
.status-appointed { background: #14532d; color: #fff; }
.status-rejected { background: #fee2e2; color: #b91c1c; }
.status-pending { background: #fed7aa; color: #9a3412; }

@media print {
  .no-print { display: none !important; }
  @page { size: A4; margin: 12mm; }
}

/* Toast container */
.toast-container { position: fixed; right: 1rem; top: 1rem; z-index: 100; display: flex; flex-direction: column; gap: 0.5rem; }
.toast { padding: 0.75rem 1rem; border-radius: 0.5rem; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: flex; align-items: center; gap: 0.5rem; min-width: 240px; max-width: 360px; animation: slideInRight 0.25s ease; }
.toast-success { background: #f0fdf4; color: #166534; border-left: 4px solid #16a34a; }
.toast-error   { background: #fef2f2; color: #991b1b; border-left: 4px solid #dc2626; }
.toast-info    { background: #eff6ff; color: #1e40af; border-left: 4px solid #2563eb; }
.toast-warning { background: #fffbeb; color: #92400e; border-left: 4px solid #d97706; }
@keyframes slideInRight { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Searchable dropdown */
.sd-wrap { position: relative; }
.sd-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #d1d5db; border-radius: 0.375rem; box-shadow: 0 6px 16px rgba(0,0,0,0.08); max-height: 240px; overflow-y: auto; z-index: 30; margin-top: 2px; }
.sd-item { padding: 0.5rem 0.75rem; cursor: pointer; font-size: 0.8125rem; color: #1f2937; }
.sd-item:hover, .sd-item.active { background: #F4F6FA; color: #1B3A6B; }
.sd-empty { padding: 0.75rem; text-align: center; color: #94a3b8; font-size: 0.75rem; }

/* Editor */
.editor-toolbar { display: flex; gap: 4px; padding: 6px 8px; border: 1px solid #d1d5db; border-bottom: none; border-radius: 0.375rem 0.375rem 0 0; background: #f8fafc; }
.editor-toolbar button { padding: 4px 8px; border-radius: 0.25rem; font-size: 0.75rem; color: #374151; cursor: pointer; background: transparent; border: 1px solid transparent; }
.editor-toolbar button:hover { background: #fff; border-color: #d1d5db; }
.editor-area { min-height: 140px; max-height: 400px; padding: 0.625rem 0.75rem; border: 1px solid #d1d5db; border-radius: 0 0 0.375rem 0.375rem; outline: none; font-size: 0.8125rem; overflow-y: auto; background: #fff; }
.editor-area:focus { border-color: #1B3A6B; box-shadow: 0 0 0 3px rgba(27,58,107,0.1); }
