/* ============================================================
   UVTAB HRMS - Custom Stylesheet
   Uganda Vocational and Technical Assessment Board
   ============================================================ */

:root {
  --uvtab-blue:     #1B3A7A;
  --uvtab-blue-lt:  #2756B6;
  --uvtab-yellow:   #F5C500;
  --uvtab-red:      #C8102E;
  --uvtab-black:    #1A1A1A;
  --sidebar-width:  265px;
  --header-height:  60px;
  --bg-light:       #F4F6FA;
  --card-shadow:    0 2px 12px rgba(27,58,122,0.09);
  --border-color:   #E3E8F0;
  --text-muted:     #6C757D;
  --success:        #1E7D50;
  --danger:         #C8102E;
  --warning:        #E8900A;
  --info:           #0A6EBD;
  --transition:     all 0.2s ease;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', 'Inter', Arial, sans-serif;
  background: var(--bg-light);
  color: var(--uvtab-black);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f0f0; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--uvtab-blue); }

/* ---- LOGIN PAGE ---- */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--uvtab-blue) 0%, var(--uvtab-blue-lt) 60%, #3D6FD4 100%);
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo img { height: 80px; width: auto; }
.login-logo .org-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.login-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--uvtab-blue);
  text-align: center;
  margin-bottom: 24px;
}

/* ---- LAYOUT ---- */
.app-wrapper { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--uvtab-blue);
  color: #fff;
  position: fixed;
  top: 0; left: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  min-height: var(--header-height);
  text-decoration: none;
}
.sidebar-brand img { height: 40px; width: 40px; object-fit: contain; flex-shrink: 0; }
.sidebar-brand-text { flex: 1; overflow: hidden; }
.sidebar-brand-text .app-title {
  font-size: 15px; font-weight: 700; color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-brand-text .app-sub {
  font-size: 10px; color: rgba(255,255,255,0.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  color: rgba(255,255,255,0.45); text-transform: uppercase;
  padding: 12px 20px 4px;
}
.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: rgba(255,255,255,0.82);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  border-radius: 0; transition: var(--transition);
  white-space: nowrap;
}
.sidebar-nav .nav-link i { width: 18px; text-align: center; font-size: 14px; flex-shrink: 0; }
.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  background: rgba(255,255,255,0.13);
  color: #fff;
  border-left: 3px solid var(--uvtab-yellow);
  padding-left: 17px;
}
.sidebar-nav .nav-link .badge {
  margin-left: auto; font-size: 10px;
  background: var(--uvtab-yellow); color: var(--uvtab-black);
}
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 12px; color: rgba(255,255,255,0.5);
}

/* ---- MAIN CONTENT ---- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1; min-height: 100vh;
  display: flex; flex-direction: column;
  transition: var(--transition);
}

/* ---- TOP NAVBAR ---- */
.topbar {
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky; top: 0; z-index: 1030;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar .toggle-btn {
  background: none; border: none; padding: 6px 8px;
  cursor: pointer; color: var(--text-muted); font-size: 18px;
}
.topbar .toggle-btn:hover { color: var(--uvtab-blue); }
.topbar .page-title {
  font-size: 16px; font-weight: 600; color: var(--uvtab-blue);
  flex: 1;
}
.topbar .topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar .notif-btn {
  position: relative; background: none; border: none;
  font-size: 18px; cursor: pointer; color: var(--text-muted);
  padding: 4px;
}
.topbar .notif-btn:hover { color: var(--uvtab-blue); }
.notif-badge {
  position: absolute; top: -3px; right: -4px;
  background: var(--danger); color: #fff;
  font-size: 9px; width: 16px; height: 16px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none; cursor: pointer;
  padding: 4px 8px; border-radius: 8px; transition: var(--transition);
}
.user-menu-btn:hover { background: var(--bg-light); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; background: var(--uvtab-blue);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 13px;
  overflow: hidden; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; color: var(--uvtab-black); }
.user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; }

/* ---- PAGE CONTENT ---- */
.page-content { padding: 24px; flex: 1; }

/* ---- PAGE HEADER ---- */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 {
  font-size: 22px; font-weight: 700; color: var(--uvtab-blue); margin: 0;
}
.page-header .breadcrumb {
  font-size: 12px; color: var(--text-muted); margin: 0; background: none; padding: 0;
}

/* ---- STATS CARDS ---- */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(27,58,122,0.14); }
.stat-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon.blue   { background: #EBF0FB; color: var(--uvtab-blue); }
.stat-icon.green  { background: #E8F5EE; color: var(--success); }
.stat-icon.yellow { background: #FEF8E3; color: #B8860B; }
.stat-icon.red    { background: #FAEAEA; color: var(--danger); }
.stat-icon.purple { background: #F0EBF8; color: #6B3FA0; }
.stat-info .stat-value {
  font-size: 26px; font-weight: 800; color: var(--uvtab-black); line-height: 1.1;
}
.stat-info .stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ---- CARDS ---- */
.card {
  background: #fff; border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow); overflow: hidden;
}
.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
}
.card-header h5, .card-header h6 {
  margin: 0; font-weight: 700;
  color: var(--uvtab-blue); font-size: 14px;
}
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--border-color); background: #FAFBFD; }

/* ---- TABLES ---- */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.data-table thead th {
  background: #F4F6FA; font-size: 12px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 14px; border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-color);
  font-size: 13.5px; color: var(--uvtab-black); vertical-align: middle;
}
.data-table tbody tr:hover { background: #F8FAFF; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .actions a, .data-table .actions button {
  padding: 4px 10px; font-size: 12px; border-radius: 6px;
  text-decoration: none; font-weight: 500; transition: var(--transition);
}

/* ---- FORMS ---- */
.form-label { font-weight: 600; font-size: 13px; color: #444; margin-bottom: 4px; }
.form-control, .form-select {
  border: 1px solid #D0D9EA; border-radius: 8px;
  padding: 8px 12px; font-size: 13.5px; color: var(--uvtab-black);
  transition: var(--transition); background: #fff;
}
.form-control:focus, .form-select:focus {
  border-color: var(--uvtab-blue); box-shadow: 0 0 0 3px rgba(27,58,122,0.12);
  outline: none;
}
.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { font-size: 12px; color: var(--danger); }
textarea.form-control { resize: vertical; min-height: 80px; }
.input-group-text {
  background: #F4F6FA; border: 1px solid #D0D9EA;
  border-radius: 8px 0 0 8px; padding: 8px 12px;
  font-size: 13px; color: var(--text-muted);
}

/* ---- BUTTONS ---- */
.btn {
  border-radius: 8px; font-size: 13.5px; font-weight: 600;
  padding: 8px 18px; cursor: pointer; transition: var(--transition);
  border: 1px solid transparent; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-primary { background: var(--uvtab-blue); color: #fff; border-color: var(--uvtab-blue); }
.btn-primary:hover { background: #152E63; color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #165E3B; color: #fff; }
.btn-danger  { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover  { background: #A00D23; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #C07008; color: #fff; }
.btn-info    { background: var(--info); color: #fff; border-color: var(--info); }
.btn-info:hover    { background: #085090; color: #fff; }
.btn-outline-primary { background: transparent; color: var(--uvtab-blue); border-color: var(--uvtab-blue); }
.btn-outline-primary:hover { background: var(--uvtab-blue); color: #fff; }
.btn-outline-secondary { background: transparent; color: var(--text-muted); border-color: #ccc; }
.btn-outline-secondary:hover { background: #eee; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-icon { padding: 6px 8px; }

/* ---- BADGES ---- */
.badge {
  padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-active    { background: #E8F5EE; color: var(--success); }
.badge-inactive  { background: #F0F0F0; color: var(--text-muted); }
.badge-pending   { background: #FEF8E3; color: #8B6914; }
.badge-approved  { background: #E8F5EE; color: var(--success); }
.badge-rejected  { background: #FAEAEA; color: var(--danger); }
.badge-draft     { background: #F0F0F0; color: #555; }
.badge-review    { background: #EBF0FB; color: var(--uvtab-blue); }
.badge-completed { background: #E8F5EE; color: var(--success); }

/* ---- ALERTS ---- */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: 13.5px;
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid transparent; margin-bottom: 16px;
}
.alert-success { background: #E8F5EE; color: var(--success); border-color: #B8DFC9; }
.alert-danger  { background: #FAEAEA; color: var(--danger); border-color: #EDB8B8; }
.alert-warning { background: #FEF8E3; color: #8B6914; border-color: #F0DCB0; }
.alert-info    { background: #EBF0FB; color: var(--uvtab-blue); border-color: #B8CAED; }

/* ---- STATUS STEPS ---- */
.status-steps {
  display: flex; gap: 0; margin: 16px 0; overflow-x: auto; padding-bottom: 4px;
}
.step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1; min-width: 80px; position: relative;
}
.step:not(:last-child)::after {
  content: ''; position: absolute; top: 12px; left: 50%; right: -50%;
  height: 2px; background: #D0D9EA; z-index: 0;
}
.step.done:not(:last-child)::after { background: var(--success); }
.step-dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #D0D9EA; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; z-index: 1;
}
.step.done .step-dot   { background: var(--success); }
.step.active .step-dot { background: var(--uvtab-blue); }
.step-label { font-size: 11px; color: var(--text-muted); text-align: center; }

/* ---- SEARCH BAR ---- */
.search-bar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: #fff; padding: 14px 18px; border-radius: 10px;
  border: 1px solid var(--border-color); margin-bottom: 18px;
  box-shadow: var(--card-shadow);
}
.search-bar .form-control { max-width: 280px; }

/* ---- SIDEBAR OVERLAY (mobile) ---- */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 1035;
  background: rgba(0,0,0,0.4);
}
.sidebar-overlay.show { display: block; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}
.empty-state i { font-size: 48px; color: #D0D9EA; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ---- PROFILE PHOTO ---- */
.emp-photo {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  background: var(--uvtab-blue); color: #fff; font-weight: 700;
  font-size: 14px; display: inline-flex; align-items: center; justify-content: center;
}
.emp-photo-lg {
  width: 90px; height: 90px; border-radius: 12px; object-fit: cover;
  border: 3px solid var(--border-color);
}

/* ---- MODAL ---- */
.modal-header { background: var(--uvtab-blue); color: #fff; padding: 14px 20px; }
.modal-header .btn-close { filter: invert(1); }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-footer { padding: 12px 20px; }

/* ---- PRINT STYLES ---- */
@media print {
  .sidebar, .topbar, .page-header .btn, .no-print, .search-bar, .sidebar-overlay { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: #fff !important; font-size: 12pt; }
  .print-form { padding: 0 !important; }
  .card { box-shadow: none !important; border: none !important; }
  .page-content { padding: 0 !important; }

  .print-paper {
    max-width: 100% !important; margin: 0; padding: 15mm 15mm;
    font-size: 10pt; line-height: 1.5;
  }
  .print-header { display: flex !important; align-items: center; gap: 16px; margin-bottom: 10mm; }
  .print-logo { height: 60px; width: auto; }
  .print-org-info { flex: 1; }
  .print-title { text-align: center; font-size: 13pt; font-weight: 700; text-transform: uppercase; }
  .print-divider { border-top: 2px solid #000; margin: 3mm 0; }
  .print-divider-thin { border-top: 1px solid #000; margin: 2mm 0; }

  table { border-collapse: collapse; width: 100%; }
  table td, table th { border: 1px solid #000; padding: 3mm 4mm; font-size: 9pt; }
  table th { background: #e0e0e0 !important; font-weight: 700; }

  .form-field {
    border-bottom: 1px solid #000; min-height: 6mm;
    display: inline-block; width: 100%; margin-bottom: 2mm;
  }
  .form-field-sm { width: 120px; display: inline-block; border-bottom: 1px solid #000; }
  .sig-line { border-bottom: 1px solid #000; width: 200px; display: inline-block; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.2); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
  .stat-card { padding: 14px 16px; }
  .stat-icon { width: 44px; height: 44px; font-size: 18px; }
  .stat-info .stat-value { font-size: 22px; }
}
@media (max-width: 575.98px) {
  .topbar { padding: 0 14px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .login-card { padding: 28px 20px; }
}

/* ---- LOADING SPINNER ---- */
.spinner-overlay {
  position: fixed; inset: 0; background: rgba(255,255,255,0.8);
  z-index: 9999; display: flex; align-items: center; justify-content: center;
}
.spinner { width: 40px; height: 40px; border: 4px solid #e0e6f5;
  border-top: 4px solid var(--uvtab-blue); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- CHART CONTAINERS ---- */
.chart-container { position: relative; height: 240px; }

/* ---- PROGRESS BARS ---- */
.progress { height: 8px; border-radius: 4px; background: #E3E8F0; overflow: hidden; }
.progress-bar { border-radius: 4px; transition: width 0.6s ease; }
.progress-bar.bg-primary { background: var(--uvtab-blue) !important; }

/* ---- DEPARTMENT BADGE ---- */
.dept-badge {
  background: var(--bg-light); border: 1px solid var(--border-color);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600; color: #555;
}

/* ---- SCORE DISPLAY ---- */
.score-pill {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%; font-size: 14px; font-weight: 800;
  border: 3px solid;
}
.score-pill.poor      { color: var(--danger);  border-color: var(--danger);  }
.score-pill.good      { color: var(--warning); border-color: var(--warning); }
.score-pill.very-good { color: var(--info);    border-color: var(--info);    }
.score-pill.excellent { color: var(--success); border-color: var(--success); }
.score-pill.outstanding { color: var(--uvtab-blue); border-color: var(--uvtab-blue); }

/* ---- TABS ---- */
.nav-tabs .nav-link {
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  border-radius: 8px 8px 0 0; padding: 9px 18px; border: none;
}
.nav-tabs .nav-link.active {
  color: var(--uvtab-blue); border-bottom: 2px solid var(--uvtab-blue);
  background: #fff;
}
.nav-tabs { border-bottom: 2px solid var(--border-color); }

/* ---- KANBAN-STYLE LISTS ---- */
.pipeline-card {
  background: #fff; border: 1px solid var(--border-color);
  border-radius: 10px; padding: 14px; margin-bottom: 10px;
  transition: var(--transition); cursor: default;
}
.pipeline-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); border-color: var(--uvtab-blue-lt); }
