/* ============================================================
   THIQLA Performance Management System – Global Styles
   ============================================================ */

:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --secondary: #06B6D4;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  --white: #FFFFFF;
  --sidebar-width: 260px;
  --topbar-height: 64px;
  --border-radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
  --transition: all .2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

/* ── Utility ── */
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.text-sm { font-size: 12px; }
.text-muted { color: var(--gray-500); }
.text-center { text-align: center; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page { min-height: 100vh; background: linear-gradient(135deg, #4F46E5 0%, #06B6D4 100%); }

.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

/* ── THIQLA Wordmark ── */
.brand-wordmark {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 6px;
  color: #FFFFFF;
  display: block;
}

/* Keep legacy classes non-breaking in case referenced elsewhere */
.logo-icon { display: none; }
.logo-text  { display: none; }

.brand-tagline { color: rgba(255,255,255,.85); font-size: 14px; font-weight: 400; }

.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}

.login-title { font-size: 22px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.login-subtitle { color: var(--gray-500); font-size: 13px; margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrapper > i:first-child {
  position: absolute; left: 12px;
  color: var(--gray-400); font-size: 14px; pointer-events: none;
}
.input-icon-wrapper input {
  width: 100%;
  padding: 10px 40px 10px 38px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--gray-50);
  transition: var(--transition);
}
.input-icon-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.toggle-password {
  position: absolute; right: 12px;
  color: var(--gray-400);
  font-size: 14px;
  padding: 0;
}

.alert {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 14px;
}
.alert-error { background: #FEF2F2; color: var(--danger); border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: var(--success); border: 1px solid #BBF7D0; }
.alert-warning { background: #FFFBEB; color: var(--warning); border: 1px solid #FDE68A; }
.alert-info { background: #EFF6FF; color: var(--info); border: 1px solid #BFDBFE; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,.35); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #059669; }
.btn-warning { background: var(--warning); color: var(--white); }
.btn-warning:hover { background: #D97706; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #DC2626; }
.btn-outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.login-demo-accounts { margin-top: 24px; text-align: center; }
.demo-label { font-size: 12px; color: var(--gray-500); margin-bottom: 8px; }
.demo-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.demo-badge {
  padding: 5px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  font-size: 12px;
  color: var(--gray-600);
  transition: var(--transition);
}
.demo-badge:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.login-footer { color: rgba(255,255,255,.6); font-size: 12px; margin-top: 24px; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform .3s ease;
  overflow-y: auto;
}
.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand { display: flex; align-items: center; gap: 0; }
.sidebar-brand .logo-text { display: none; }
.sidebar-close-btn { color: var(--gray-400); display: none; font-size: 18px; }

.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 16px;
  background: rgba(255,255,255,.05);
  margin: 12px;
  border-radius: 10px;
}
.user-avatar {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: var(--white);
  flex-shrink: 0;
}
.user-avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.user-info { overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(79,70,229,.4);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  color: #C7D2FE;
}

.sidebar-nav { flex: 1; padding: 12px 8px; }
.sidebar-nav ul li { margin-bottom: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-400);
  transition: var(--transition);
  cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: var(--white); }
.nav-item.active { background: var(--primary); color: var(--white); }
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-section-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--gray-600);
  padding: 16px 12px 6px;
}

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-logout-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--gray-400);
  transition: var(--transition);
}
.sidebar-logout-btn:hover { background: rgba(239,68,68,.15); color: var(--danger); }

.sidebar-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 99;
}

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

/* ── Topbar ── */
.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 90;
  box-shadow: var(--shadow-sm);
}
.topbar-menu-btn { color: var(--gray-600); font-size: 18px; display: none; }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--gray-900); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.notification-bell {
  position: relative; cursor: pointer;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  transition: var(--transition);
}
.notification-bell:hover { background: var(--gray-100); color: var(--gray-900); }
.notif-badge {
  position: absolute; top: 4px; right: 4px;
  width: 16px; height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 9px; font-weight: 700; color: var(--white);
  display: flex; align-items: center; justify-content: center;
}

.topbar-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 13px; font-weight: 600; color: var(--gray-700);
}
.topbar-user:hover { background: var(--gray-100); }

.notif-panel {
  position: fixed; top: var(--topbar-height); right: 16px;
  width: 340px; max-height: 420px;
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  z-index: 200;
  overflow: hidden;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px; font-weight: 700;
}
.notif-header button { font-size: 11px; color: var(--primary); font-weight: 500; }
.notif-list { overflow-y: auto; max-height: 360px; }
.notif-item {
  display: flex; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-50);
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--primary-light); }
.notif-item-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.notif-item-content p { font-size: 12px; font-weight: 500; color: var(--gray-800); margin-bottom: 2px; }
.notif-item-content span { font-size: 11px; color: var(--gray-400); }

/* ── Page Content ── */
.page-content { padding: 24px; flex: 1; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.page-header p { color: var(--gray-500); font-size: 13px; }

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
  min-width: 0;          /* allow flex children to shrink */
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

/* Icon */
.stat-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.stat-icon.purple { background: var(--primary-light); color: var(--primary); }
.stat-icon.cyan   { background: #ECFEFF;  color: var(--secondary); }
.stat-icon.green  { background: #F0FDF4;  color: var(--success); }
.stat-icon.yellow { background: #FFFBEB;  color: var(--warning); }
.stat-icon.red    { background: #FEF2F2;  color: var(--danger); }

/* Text block — must be able to shrink */
.stat-card > div:not(.stat-icon) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

/* Numeric value (large) */
.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Text value — auto-scales when content is a word/phrase, not a number */
.stat-value.stat-value-text {
  font-size: clamp(11px, 1.8vw, 15px);
  font-weight: 700;
  white-space: normal;
  line-height: 1.25;
  word-break: break-word;
}

.stat-label {
  font-size: 11px;
  color: var(--gray-500);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-change { font-size: 11px; font-weight: 600; margin-top: 4px; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* Responsive: tighter padding on small screens */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card  { padding: 12px 14px; gap: 10px; }
  .stat-icon  { width: 38px; height: 38px; font-size: 15px; border-radius: 9px; }
  .stat-value { font-size: 20px; }
  .stat-value.stat-value-text { font-size: 12px; }
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.card-body { padding: 20px; }

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Status Badge ── */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
}
.status-badge.not-started { background: var(--gray-100); color: var(--gray-500); }
.status-badge.self-assessment { background: #FEF9C3; color: #854D0E; }
.status-badge.superior-review { background: #DBEAFE; color: #1E40AF; }
.status-badge.hr-review { background: #F3E8FF; color: #6B21A8; }
.status-badge.completed { background: #DCFCE7; color: #166534; }

/* ── Table ── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--gray-200); }
thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--gray-500);
}
tbody tr { border-bottom: 1px solid var(--gray-100); transition: var(--transition); }
tbody tr:hover { background: var(--gray-50); }
tbody td { padding: 12px 16px; font-size: 13px; color: var(--gray-700); }
tbody td.td-name { font-weight: 600; color: var(--gray-900); }

/* ── Progress Bar ── */
.progress-bar-wrapper { display: flex; align-items: center; gap: 10px; }
.progress-bar { flex: 1; height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.progress-fill.green { background: var(--success); }
.progress-fill.yellow { background: var(--warning); }
.progress-fill.red { background: var(--danger); }
.progress-fill.blue { background: var(--primary); }
.progress-value { font-size: 12px; font-weight: 600; color: var(--gray-700); min-width: 35px; }

/* ============================================================
   EVALUATION FORM
   ============================================================ */
.eval-container { max-width: 960px; margin: 0 auto; }

.eval-header-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  border-radius: 14px;
  padding: 28px 32px;
  margin-bottom: 24px;
  box-shadow: 0 8px 24px rgba(79,70,229,.3);
}
.eval-header-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.eval-header-card p { font-size: 13px; opacity: .85; }
.eval-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.eval-meta-item span { font-size: 11px; opacity: .7; display: block; margin-bottom: 2px; }
.eval-meta-item p { font-size: 14px; font-weight: 600; }

.eval-status-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 0;
  margin-bottom: 28px;
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 20px 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.eval-step {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1;
  position: relative;
}
.eval-step::before {
  content: '';
  position: absolute;
  top: 16px; right: -50%;
  width: 100%; height: 2px;
  background: var(--gray-200);
  z-index: 0;
}
.eval-step:last-child::before { display: none; }
.eval-step.done::before { background: var(--success); }
.eval-step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; position: relative; z-index: 1;
  border: 2px solid var(--gray-200);
}
.eval-step.active .eval-step-dot { background: var(--primary); color: var(--white); border-color: var(--primary); }
.eval-step.done .eval-step-dot { background: var(--success); color: var(--white); border-color: var(--success); }
.eval-step-label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-align: center; }
.eval-step.active .eval-step-label { color: var(--primary); }
.eval-step.done .eval-step-label { color: var(--success); }

/* Section tabs */
.eval-sections { margin-bottom: 20px; }
.section-tab-bar {
  display: flex; gap: 4px;
  background: var(--gray-100);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--gray-600);
  transition: var(--transition);
  flex: 1; text-align: center;
}
.section-tab.active { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }

/* KPI Table */
.kpi-section { margin-bottom: 28px; }
.kpi-section-title {
  font-size: 14px; font-weight: 700; color: var(--gray-900);
  padding: 12px 0; margin-bottom: 12px;
  border-bottom: 2px solid var(--primary-light);
}
.kpi-section-weight {
  display: inline-block;
  padding: 2px 8px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
  margin-left: 8px;
}

.kpi-row {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition);
}
.kpi-row:hover { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.kpi-row-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.kpi-title { font-size: 13px; font-weight: 600; color: var(--gray-900); line-height: 1.5; }
.kpi-desc { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.kpi-weight-pill {
  flex-shrink: 0;
  padding: 4px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 11px; font-weight: 700;
}

.kpi-inputs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.kpi-input-group label { display: block; font-size: 11px; font-weight: 600; color: var(--gray-500); margin-bottom: 4px; }
.kpi-input-group input, .kpi-input-group select, .kpi-input-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: 7px;
  font-size: 13px;
  color: var(--gray-800);
  transition: var(--transition);
}
.kpi-input-group input:focus, .kpi-input-group select:focus, .kpi-input-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.kpi-input-group input[readonly] { background: var(--gray-50); color: var(--gray-500); cursor: default; }
.kpi-input-group textarea { resize: vertical; min-height: 72px; }

.kpi-score-display {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--gray-50); border-radius: 8px;
  padding: 10px 14px; margin-top: 10px;
}
.kpi-score-display span { font-size: 12px; color: var(--gray-500); }
.kpi-score-display strong { font-size: 18px; font-weight: 800; color: var(--primary); }

.score-summary-box {
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
  color: var(--white);
  border-radius: 12px;
  padding: 20px 24px;
  margin-top: 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.score-summary-label { font-size: 13px; opacity: .75; margin-bottom: 2px; }
.score-summary-value { font-size: 32px; font-weight: 900; }
.score-summary-band {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 700;
}
.band-excellent         { background: #DCFCE7; color: #166534; }   /* 95+  */
.band-exceeds           { background: #DBEAFE; color: #1E40AF; }   /* 85-94 */
.band-meets             { background: #EDE9FE; color: #5B21B6; }   /* 70-84 */
.band-needs-improvement { background: #FFFBEB; color: #854D0E; }   /* 50-69 */
.band-poor              { background: #FEF2F2; color: #991B1B; }   /* 0-49  */

/* Competency / Behavior form */
.competency-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.competency-name { font-size: 13px; font-weight: 700; color: var(--gray-900); margin-bottom: 4px; }
.competency-desc { font-size: 12px; color: var(--gray-500); margin-bottom: 12px; }
.rating-stars { display: flex; gap: 6px; }
.rating-star {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-200);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--gray-400);
}
.rating-star.selected { background: var(--warning); border-color: var(--warning); color: var(--white); }
.rating-star:hover { border-color: var(--warning); color: var(--warning); }

/* ── KPI Editable Header ── */
.kpi-editable-header {
  position: relative;
  background: linear-gradient(135deg, #F8F9FF 0%, #F0F3FF 100%);
  border: 1.5px solid #C7D2FE;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.kpi-header-fields {
  display: grid;
  grid-template-columns: 1fr 120px 150px;
  gap: 12px;
  margin-bottom: 10px;
}
.kpi-header-field { display: flex; flex-direction: column; gap: 4px; }
.kpi-field-indicator { margin-bottom: 0; }
.kpi-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 5px;
}
.kpi-header-input {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #C7D2FE;
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-900);
  background: var(--white);
  transition: var(--transition);
  resize: none;
  line-height: 1.5;
}
.kpi-header-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: var(--white);
}
.kpi-header-input[readonly] {
  background: var(--gray-50);
  color: var(--gray-600);
  cursor: default;
  border-color: var(--gray-200);
}
.kpi-scope-input { font-weight: 600; font-size: 14px; }
.kpi-indicator-input { min-height: 56px; }

.kpi-weight-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px solid #C7D2FE;
  border-radius: 7px;
  overflow: hidden;
  background: var(--white);
  transition: var(--transition);
}
.kpi-weight-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.kpi-weight-input {
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  flex: 1;
  min-width: 0;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--primary);
  padding: 8px 6px;
}
.kpi-weight-input:focus { outline: none; box-shadow: none; }
.kpi-weight-unit {
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  height: 100%;
  display: flex;
  align-items: center;
  border-left: 1px solid #C7D2FE;
}

/* ── KPI Correlation Toggle ── */
.kpi-corr-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  border: 1px solid #E0E7FF;
}

/* The toggle button itself */
.kpi-corr-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  letter-spacing: .2px;
  flex-shrink: 0;
}
.kpi-corr-toggle-btn:focus { outline: none; }

/* Positive mode — indigo/blue */
.kpi-corr-positive {
  background: #EEF2FF;
  color: #4338CA;
  border-color: #C7D2FE;
}
.kpi-corr-positive:hover {
  background: #4338CA;
  color: #fff;
  border-color: #4338CA;
  box-shadow: 0 2px 8px rgba(67,56,202,.25);
}

/* Negative mode — amber/orange */
.kpi-corr-negative {
  background: #FFF7ED;
  color: #C2410C;
  border-color: #FED7AA;
}
.kpi-corr-negative:hover {
  background: #C2410C;
  color: #fff;
  border-color: #C2410C;
  box-shadow: 0 2px 8px rgba(194,65,12,.25);
}

/* Hint text */
.kpi-corr-hint {
  font-size: 11px;
  color: var(--gray-500);
  flex: 1;
  min-width: 0;
}

/* Formula chip */
.kpi-corr-formula {
  font-size: 10px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .2px;
}

/* Delete button on KPI card */
.kpi-delete-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #FEE2E2;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  opacity: .7;
}
.kpi-delete-btn:hover { opacity: 1; background: var(--danger); color: var(--white); transform: scale(1.1); }

/* Add KPI button */
.btn-add-kpi {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  margin-top: 4px;
  border: 2px dashed var(--primary);
  border-radius: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  background: var(--primary-light);
  cursor: pointer;
  transition: var(--transition);
}
.btn-add-kpi:hover {
  background: var(--primary);
  color: var(--white);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79,70,229,.25);
}
.btn-add-kpi i { font-size: 16px; }

/* KPI column layout */
.kpi-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.kpi-col { border-radius: 8px; padding: 14px; }
.kpi-col-self     { background: #FAFBFF; border: 1px solid #E0E7FF; }
.kpi-col-superior { background: #F0FDF4; border: 1px solid #BBF7D0; }
.kpi-col-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.kpi-col-label-self     { color: var(--primary); }
.kpi-col-label-superior { color: var(--success); }

/* Superior column active state */
.kpi-col-superior-active {
  background: #ECFDF5 !important;
  border: 2px solid var(--success) !important;
  box-shadow: 0 0 0 3px rgba(16,185,129,.1);
}
.kpi-col-superior-active .kpi-input-group input,
.kpi-col-superior-active .kpi-input-group textarea {
  border-color: #6EE7B7;
  background: var(--white);
}
.kpi-col-superior-active .kpi-input-group input:focus,
.kpi-col-superior-active .kpi-input-group textarea:focus {
  border-color: var(--success);
  box-shadow: 0 0 0 2px rgba(16,185,129,.2);
  outline: none;
}

/* Editable badge on superior col label */
.kpi-editable-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  background: var(--success);
  color: var(--white);
  border-radius: 10px;
  font-size: 9px;
  font-weight: 700;
  margin-left: 6px;
  letter-spacing: .3px;
}

/* Weight input wrapper read-only state */
.kpi-weight-input-wrapper.weight-readonly {
  background: var(--gray-50);
  border-color: var(--gray-200);
}
.kpi-weight-input-wrapper.weight-readonly .kpi-weight-input {
  color: var(--gray-500);
}
.kpi-weight-input-wrapper.weight-readonly .kpi-weight-unit {
  background: var(--gray-100);
  color: var(--gray-400);
  border-color: var(--gray-200);
}

/* Info banner for KPI section */
.kpi-info-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-500);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: 8px;
  line-height: 1.6;
}

/* Weight warning */
.kpi-weight-warning {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--danger);
  background: #FEF2F2;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 10px;
}

/* Responsive KPI */
@media (max-width: 680px) {
  .kpi-columns-grid { grid-template-columns: 1fr; }
  .kpi-header-fields { grid-template-columns: 1fr 1fr; }
  .kpi-field-scope { grid-column: 1 / -1; }
  .kpi-weight-input-wrapper { max-width: 120px; }
}

/* URL input banner */
.url-input-banner {
  background: linear-gradient(90deg, #EEF2FF, #E0E7FF);
  border: 1.5px solid #C7D2FE;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.url-input-banner i { color: var(--primary); font-size: 18px; }
.url-input-banner input {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
}

/* Action bar */
.eval-action-bar {
  position: sticky; bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: 0 -4px 20px rgba(0,0,0,.08);
  z-index: 80;
  margin: 20px -24px -24px;
}

/* ============================================================
   ADMIN MONITOR
   ============================================================ */
.monitor-filters {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-select {
  padding: 8px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-700);
  background: var(--white);
  cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

.search-input-wrapper {
  position: relative; flex: 1;
}
.search-input-wrapper i {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--gray-400);
}
.search-input {
  width: 100%; padding: 8px 12px 8px 36px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px; font-size: 13px;
}
.search-input:focus { outline: none; border-color: var(--primary); }

/* ============================================================
   FUNNEL PANEL — redesigned with period dropdown + bar chart
   ============================================================ */

.funnel-card-wrapper { margin-bottom: 20px; }

.funnel-panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── Header ── */
.funnel-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(135deg, #F8FAFF 0%, #EEF2FF 100%);
  border-bottom: 1px solid #E0E7FF;
  flex-wrap: wrap;
}
.funnel-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 8px;
}
.funnel-panel-title i { color: var(--primary); }

.funnel-panel-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Period select dropdown ── */
.funnel-period-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.funnel-select-icon {
  position: absolute;
  left: 10px;
  font-size: 12px;
  color: var(--primary);
  pointer-events: none;
  z-index: 1;
}
.funnel-period-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 7px 32px 7px 30px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  background: var(--white);
  border: 1.5px solid #C7D2FE;
  border-radius: 8px;
  cursor: pointer;
  min-width: 180px;
  max-width: 260px;
  transition: border-color .2s, box-shadow .2s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234F46E5' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.funnel-period-select:hover,
.funnel-period-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
  outline: none;
}

/* ── Completion badge ── */
.funnel-completion-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .3px;
}
.funnel-pct-great { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.funnel-pct-mid   { background: #FEF9C3; color: #713F12; border: 1px solid #FDE047; }
.funnel-pct-low   { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }

/* ── Period meta row ── */
.funnel-period-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 20px;
  background: #F8FAFF;
  border-bottom: 1px solid #E0E7FF;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--gray-500);
}
.funnel-period-meta span { display: inline-flex; align-items: center; gap: 5px; }
.funnel-period-meta i { color: var(--primary); font-size: 11px; }

.funnel-period-status-badge {
  padding: 2px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.funnel-period-active { background: #DCFCE7; color: #166534; }
.funnel-period-closed { background: #F3F4F6; color: #6B7280; }

/* ── Bar rows ── */
.funnel-bars-wrap {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.funnel-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 70px;
  align-items: center;
  gap: 12px;
}

.funnel-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

.funnel-bar-icon {
  font-size: 13px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.funnel-bar-icon.f-not-started { color: var(--gray-400); }
.funnel-bar-icon.f-self        { color: var(--warning); }
.funnel-bar-icon.f-superior    { color: var(--info); }
.funnel-bar-icon.f-hr          { color: #8B5CF6; }
.funnel-bar-icon.f-done        { color: var(--success); }

.funnel-bar-track {
  height: 10px;
  background: var(--gray-100);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.funnel-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width .5s cubic-bezier(.4,0,.2,1);
}
.funnel-bar-fill.f-not-started { background: linear-gradient(90deg, #D1D5DB, #9CA3AF); }
.funnel-bar-fill.f-self        { background: linear-gradient(90deg, #FCD34D, #F59E0B); }
.funnel-bar-fill.f-superior    { background: linear-gradient(90deg, #67E8F9, #0EA5E9); }
.funnel-bar-fill.f-hr          { background: linear-gradient(90deg, #C4B5FD, #7C3AED); }
.funnel-bar-fill.f-done        { background: linear-gradient(90deg, #6EE7B7, #10B981); }

.funnel-bar-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.funnel-bar-count {
  font-size: 15px;
  font-weight: 800;
  color: var(--gray-900);
  min-width: 22px;
  text-align: right;
}
.funnel-bar-pct {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 600;
  min-width: 30px;
  text-align: right;
}

/* ── Stat pills ── */
.funnel-stat-pills {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--gray-100);
}
.funnel-stat-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 8px;
  border-right: 1px solid var(--gray-100);
  transition: background .2s;
}
.funnel-stat-pill:last-child { border-right: none; }
.funnel-stat-pill:hover { background: var(--gray-50); }
.funnel-stat-pill-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
  line-height: 1;
}
.funnel-stat-pill-label {
  font-size: 10px;
  color: var(--gray-400);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.funnel-pill-done   .funnel-stat-pill-val { color: var(--success); }
.funnel-pill-inprog .funnel-stat-pill-val { color: var(--primary); }
.funnel-pill-pending .funnel-stat-pill-val{ color: var(--gray-500); }

/* Responsive funnel */
@media (max-width: 640px) {
  .funnel-bar-row { grid-template-columns: 120px 1fr 55px; gap: 8px; }
  .funnel-bar-label { font-size: 11px; }
  .funnel-stat-pills { flex-wrap: wrap; }
  .funnel-stat-pill { flex: 0 0 50%; border-bottom: 1px solid var(--gray-100); }
  .funnel-period-meta { gap: 10px; }
  .funnel-panel-header { flex-direction: column; align-items: flex-start; }
}

/* Legacy compat — keep old .funnel-card classes in case used elsewhere */
.funnel-card.f-not-started { border-color: var(--gray-300); }
.funnel-card.f-self        { border-color: var(--warning); }
.funnel-card.f-superior    { border-color: var(--info); }
.funnel-card.f-hr          { border-color: #8B5CF6; }
.funnel-card.f-done        { border-color: var(--success); }

/* User management */
/* ── User Table ── */
.user-table-wrap {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.user-table thead tr {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}
.user-table thead th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  user-select: none;
}
.user-table thead th.sortable {
  cursor: pointer;
  transition: color .15s;
}
.user-table thead th.sortable:hover { color: var(--primary); }
.user-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .12s;
}
.user-table tbody tr:last-child { border-bottom: none; }
.user-table tbody tr:hover td { background: #F8FAFF; }
.user-table tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--gray-700);
}
.inactive-row td { opacity: .55; }
.utd-no  { width: 40px;  color: var(--gray-400) !important; font-size: 11px; text-align: center; }
.utd-name { min-width: 200px; }
.utd-pos  { min-width: 120px; }
.utd-dept { min-width: 120px; }
.utd-role { width: 150px; }
.utd-superior { min-width: 120px; }
.utd-status { width: 90px; }
.utd-action { width: 90px; }

@media (max-width: 900px) {
  .utd-pos, .utd-superior { display: none; }
}
@media (max-width: 640px) {
  .utd-dept { display: none; }
  .user-table thead th, .user-table tbody td { padding: 8px 10px; }
}
.role-tag {
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10px; font-weight: 700;
}
.role-tag.admin { background: #FEE2E2; color: #991B1B; }
.role-tag.people_leader { background: #DBEAFE; color: #1E40AF; }
.role-tag.individual_contributor { background: #DCFCE7; color: #166534; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { color: var(--gray-400); font-size: 18px; }
.modal-close:hover { color: var(--gray-800); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

/* Form styles inside modal/page */
.input-field, .select-field, .textarea-field {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gray-800);
  transition: var(--transition);
  background: var(--white);
}
.input-field:focus, .select-field:focus, .textarea-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.field-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 5px;
}
.field-group { margin-bottom: 14px; }

/* Toast */
.toast-container {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 999;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--gray-900);
  color: var(--white);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  animation: toastIn .3s ease;
  min-width: 260px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--info); }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--gray-400);
}
.empty-state i { font-size: 40px; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: 14px; }

/* Loading spinner */
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}

/* ============================================================
   RESPONSIVE — legacy block (superseded by the full overhaul
   at the end of this file; kept only for properties not
   covered there, to avoid breaking existing behaviour)
   ============================================================ */
@media (max-width: 768px) {
  .kpi-inputs { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  /* covered in the RESPONSIVE OVERHAUL section below */
}

/* ============================================================
   ROLLBACK SYSTEM – Buttons, Badges, Modals, Timeline
   ============================================================ */

/* ── Rollback action button ── */
.btn-rollback {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, #EF4444, #DC2626);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-rollback:hover {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  box-shadow: 0 3px 10px rgba(239,68,68,.4);
  transform: translateY(-1px);
}
.btn-rollback:active { transform: translateY(0); }

/* ── Rollback count badge (clickable) ── */
.rollback-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.rollback-count-badge:hover {
  background: #FEE2E2;
  border-color: #EF4444;
  box-shadow: 0 2px 8px rgba(239,68,68,.2);
}

/* ── Monitor table checkmarks / dash ── */
.monitor-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--success);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.monitor-dash {
  display: inline-flex;
  align-items: center;
  color: var(--gray-300);
  font-size: 13px;
}

/* ── Warning boxes inside rollback modal ── */
.rollback-warning-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 14px;
  border: 1.5px solid transparent;
}
.rollback-warning-box i { font-size: 15px; flex-shrink: 0; margin-top: 2px; }
.rollback-warn-red {
  background: #FEF2F2;
  border-color: #FECACA;
  color: #7F1D1D;
}
.rollback-warn-red i { color: #DC2626; }
.rollback-warn-yellow {
  background: #FFFBEB;
  border-color: #FDE68A;
  color: #78350F;
}
.rollback-warn-yellow i { color: #D97706; }

/* ── Rollback modal header (employee info) ── */
.rollback-modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--gray-50);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
}
.rollback-emp-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  letter-spacing: .5px;
}
.rollback-emp-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}

/* ── Rollback detail list (what will change) ── */
.rollback-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: var(--gray-50);
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}
.rollback-detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-700);
}
.rollback-detail-item i { font-size: 13px; width: 16px; flex-shrink: 0; }

/* ── Rollback history items (in popup) ── */
.rollback-history-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gray-50);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
}
.rollback-history-num {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 50%;
  background: var(--danger);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}
.rollback-history-body { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.rollback-history-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.rollback-history-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--gray-400);
  margin-left: auto;
}
.rollback-history-by {
  font-size: 12px;
  color: var(--gray-600);
}
.rollback-history-reason {
  font-size: 12px;
  color: var(--gray-700);
  font-style: italic;
  background: var(--white);
  padding: 5px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--danger);
  margin-top: 2px;
}

/* ── Rollback timeline (full history page) ── */
.rollback-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 28px;
}
.rollback-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--gray-200);
  border-radius: 2px;
}
.rollback-timeline-item {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 20px;
}
.rollback-timeline-item:last-child { padding-bottom: 0; }
.rollback-timeline-dot {
  position: absolute;
  left: -24px;
  top: 14px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--danger);
  flex-shrink: 0;
}
.rollback-timeline-card {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 14px 16px;
  transition: var(--transition);
}
.rollback-timeline-card:hover {
  border-color: var(--danger);
  box-shadow: 0 3px 12px rgba(239,68,68,.1);
}
.rollback-timeline-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.rollback-timeline-emp {
  display: flex;
  align-items: center;
  gap: 10px;
}
.rollback-timeline-date {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
}
.rollback-timeline-by {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 6px;
}
.rollback-timeline-reason {
  font-size: 12px;
  color: var(--gray-700);
  font-style: italic;
  background: #FEF2F2;
  padding: 6px 10px;
  border-radius: 6px;
  border-left: 3px solid var(--danger);
  margin-top: 6px;
}

/* ── Mini avatar on timeline emp ── */
.rollback-emp-mini {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
}

/* ── Admin-view eval banner (read-only mode) ── */
.admin-view-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: linear-gradient(90deg, #FFFBEB, #FEF3C7);
  border: 1.5px solid #FDE68A;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #78350F;
}
.admin-view-banner i { color: #D97706; font-size: 16px; flex-shrink: 0; }
.admin-view-banner strong { color: #92400E; }

/* ── Rollback history banner (inside eval form) ── */
.rollback-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(90deg, #FEF2F2, #FEE2E2);
  border: 1.5px solid #FECACA;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #7F1D1D;
}
.rollback-banner i { color: #DC2626; font-size: 16px; flex-shrink: 0; margin-top: 2px; }
.rollback-banner-title {
  font-weight: 700;
  font-size: 13px;
  color: #991B1B;
  margin-bottom: 4px;
}
.rollback-banner-entries {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}
.rollback-banner-entry {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #B91C1C;
  padding: 3px 0;
}
.rollback-banner-entry i { width: 14px; text-align: center; }

/* ── stat-icon red variant ── */
.stat-icon.red { background: #FEE2E2; color: #DC2626; }
.stat-icon.cyan { background: #CFFAFE; color: #0891B2; }

/* ============================================================
   INDISCIPLINARY REVIEW – HR Final Review section
   ============================================================ */

.indisciplinary-card {
  border: 1.5px solid #FECACA;
  border-radius: 10px;
  overflow: hidden;
}

.indisciplinary-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(90deg, #FEF2F2, #FEE2E2);
  font-size: 13px;
  font-weight: 700;
  color: #B91C1C;
}
.indisciplinary-header i { color: #EF4444; }

.indisciplinary-badge {
  margin-left: auto;
  padding: 2px 9px;
  background: #B91C1C;
  color: #fff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.indisciplinary-body {
  padding: 14px 16px;
  background: #FFFBFB;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.indisc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid #FDE8E8;
  border-radius: 8px;
}

.indisc-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.indisc-label-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}
.indisc-label-hint {
  font-size: 10px;
  color: var(--gray-400);
  font-style: italic;
}

.indisc-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.indisc-select,
.indisc-input {
  width: 150px !important;
  font-size: 12px !important;
  padding: 6px 10px !important;
}

.indisc-readonly-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  min-width: 80px;
  text-align: right;
}

.indisc-penalty-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  padding: 3px 8px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.indisc-penalty-tag.negative {
  background: #FEF2F2;
  color: #B91C1C;
  border-color: #FECACA;
}

.indisc-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: #FEF2F2;
  border: 1.5px solid #FECACA;
  border-radius: 8px;
}
.indisc-total-label {
  font-size: 13px;
  font-weight: 700;
  color: #B91C1C;
}
.indisc-total-val {
  font-size: 16px;
  font-weight: 900;
  color: #15803D;
  min-width: 44px;
  text-align: right;
}
.indisc-total-val.negative { color: #B91C1C; }

.indisc-adjusted-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(90deg, #F5F3FF, #EDE9FE);
  border: 1.5px solid #C4B5FD;
  border-radius: 8px;
}
.indisc-adj-label {
  font-size: 12px;
  font-weight: 700;
  color: #6D28D9;
}
.indisc-adj-val {
  font-size: 22px;
  font-weight: 900;
  color: #6D28D9;
  min-width: 55px;
  text-align: right;
  transition: color .2s;
}
.indisc-adj-val.penalised { color: #DC2626; }

@media (max-width: 600px) {
  .indisc-row { flex-direction: column; align-items: flex-start; }
  .indisc-input-wrap { width: 100%; justify-content: flex-end; }
  .indisc-select, .indisc-input { width: 100% !important; }
}

/* ── Culture Rubric Table ── */
.culture-rubric-table {
  margin-bottom: 16px;
  border: 1.5px solid #C7D2FE;
  border-radius: 10px;
  overflow: hidden;
}
.culture-rubric-title {
  padding: 9px 14px;
  background: var(--primary-light);
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-dark);
  border-bottom: 1px solid #C7D2FE;
}
.culture-rubric-title i { margin-right: 6px; }
.culture-rubric {
  width: 100%;
  border-collapse: collapse;
}
.culture-rubric tbody tr:not(:last-child) td {
  border-bottom: 1px solid #EEF2FF;
}
.culture-rubric tbody tr:hover td { background: #F8FAFF; }
.rubric-score {
  width: 60px;
  text-align: center;
  padding: 9px 6px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  vertical-align: middle;
}
.rubric-score span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
}
.rubric-score-1 span { background: #FEE2E2; color: #B91C1C; }
.rubric-score-2 span { background: #FEF3C7; color: #92400E; }
.rubric-score-3 span { background: #FEF9C3; color: #713F12; }
.rubric-score-4 span { background: #D1FAE5; color: #065F46; }
.rubric-score-5 span { background: #DBEAFE; color: #1E40AF; }
.rubric-desc {
  padding: 9px 14px 9px 4px;
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
  vertical-align: middle;
}

/* ── HR Final Score Live Display ── */
.hr-final-score-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  border: 2px solid #818CF8;
  border-radius: 12px;
}
.hfsd-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hfsd-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}
.hfsd-label i { margin-right: 5px; color: #F59E0B; }
.hfsd-hint {
  font-size: 11px;
  color: var(--gray-400);
  font-style: italic;
}
.hfsd-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.hfsd-score {
  font-size: 42px;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  transition: color .3s;
}
.hfsd-band {
  font-size: 13px !important;
}
@media (max-width: 480px) {
  .hr-final-score-display { flex-direction: column; align-items: flex-start; }
  .hfsd-score { font-size: 36px; }
}

/* Responsive rollback */
@media (max-width: 600px) {
  .rollback-timeline { padding-left: 20px; }
  .rollback-timeline-dot { left: -18px; }
  .rollback-timeline-top { flex-direction: column; }
  .rollback-timeline-date { margin-left: 0; }
  .rollback-modal-header { flex-direction: column; text-align: center; }
}

/* ============================================================
   RIWAYAT EVALUASI — History page styles
   ============================================================ */

/* ── Score badge in history table ── */
.hist-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .3px;
}
.hist-score-badge.band-excellent         { background: #DCFCE7; color: #166534; border: 1.5px solid #86EFAC; }
.hist-score-badge.band-exceeds           { background: #DBEAFE; color: #1E40AF; border: 1.5px solid #93C5FD; }
.hist-score-badge.band-meets             { background: #FEF9C3; color: #713F12; border: 1.5px solid #FDE047; }
.hist-score-badge.band-needs-improvement { background: #FEF3C7; color: #92400E; border: 1.5px solid #FCD34D; }
.hist-score-badge.band-poor              { background: #FEE2E2; color: #991B1B; border: 1.5px solid #FCA5A5; }

/* ── Hero result card at top of detail page ── */
.hist-result-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #F5F3FF 100%);
  border: 2px solid #C7D2FE;
  border-radius: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.hist-result-left {
  flex: 1;
  min-width: 200px;
}
.hist-period-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.hist-result-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 12px;
}
.hist-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.hist-result-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--gray-600);
  background: var(--white);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--gray-200);
}
.hist-result-meta i { color: var(--primary); }
.hist-result-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Large score circle in hero ── */
.hist-score-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid currentColor;
  gap: 2px;
}
.hist-score-circle.band-excellent         { background: #DCFCE7; color: #166534; border-color: #4ADE80; }
.hist-score-circle.band-exceeds           { background: #DBEAFE; color: #1E40AF; border-color: #60A5FA; }
.hist-score-circle.band-meets             { background: #FEF9C3; color: #713F12; border-color: #FBBF24; }
.hist-score-circle.band-needs-improvement { background: #FEF3C7; color: #92400E; border-color: #F59E0B; }
.hist-score-circle.band-poor              { background: #FEE2E2; color: #991B1B; border-color: #F87171; }
.hist-score-num {
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}
.hist-score-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  opacity: .75;
}
.hist-band-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 4px 12px;
  border-radius: 20px;
}
.hist-band-label.band-excellent         { background: #DCFCE7; color: #166534; }
.hist-band-label.band-exceeds           { background: #DBEAFE; color: #1E40AF; }
.hist-band-label.band-meets             { background: #FEF9C3; color: #713F12; }
.hist-band-label.band-needs-improvement { background: #FEF3C7; color: #92400E; }
.hist-band-label.band-poor              { background: #FEE2E2; color: #991B1B; }

/* ── Section C history-specific elements ── */
.hist-final-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(90deg, #ECFDF5, #D1FAE5);
  border: 1.5px solid #6EE7B7;
  border-radius: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.hist-final-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hist-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-700);
  padding: 4px 0;
}
.hist-score-row-total {
  border-top: 1px solid var(--gray-200);
  margin-top: 6px;
  padding-top: 6px;
  font-weight: 700;
}

.hist-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}
.hist-section-label i { margin-right: 5px; }

.hist-text-content {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.7;
  white-space: pre-wrap;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 12px 14px;
}

.hist-recommendation-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
  border: 1.5px solid #6EE7B7;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 700;
  color: #065F46;
}

/* ── Score band legend ── */
.hist-band-legend {
  margin-top: 20px;
  padding: 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}
.hist-band-legend-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 12px;
}
.hist-band-legend-title i { margin-right: 5px; }
.hist-band-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hist-band-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  opacity: .65;
  transition: opacity .2s;
}
.hist-band-item-current {
  opacity: 1;
  border-width: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  transform: scale(1.04);
}
.hist-band-range {
  font-size: 11px;
  color: var(--gray-500);
  font-weight: 600;
}
.hist-band-yours {
  font-size: 10px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Responsive history */
@media (max-width: 640px) {
  .hist-result-hero { flex-direction: column; align-items: center; text-align: center; }
  .hist-result-meta { justify-content: center; }
  .hist-result-right { flex-direction: row; gap: 16px; }
  .hist-final-banner { flex-direction: column; }
}

/* ============================================================
   EXPORT CSV MODAL
   ============================================================ */

.export-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Scope toggle group ── */
.export-scope-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.export-scope-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s;
  background: var(--white);
  position: relative;
}
.export-scope-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.export-scope-btn:hover {
  border-color: #A5B4FC;
  background: #F8FAFF;
}
.export-scope-btn.active {
  border-color: var(--primary);
  background: #EEF2FF;
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}

.export-scope-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.export-scope-btn.active .export-scope-icon {
  background: var(--primary);
  color: #fff;
}

.export-scope-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 2px;
}
.export-scope-desc {
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.4;
}

/* ── Period radio list ── */
.export-period-list {
  border: 1.5px solid #E0E7FF;
  border-radius: 10px;
  overflow: hidden;
  background: var(--white);
}

.export-period-list-label {
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: #EEF2FF;
  border-bottom: 1px solid #E0E7FF;
}
.export-period-list-label i { margin-right: 5px; }

.export-period-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid #F1F5F9;
  position: relative;
}
.export-period-option:last-child { border-bottom: none; }
.export-period-option:hover { background: #F8FAFF; }
.export-period-option input[type="radio"] {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
}
.export-period-option:has(input:checked) {
  background: #EEF2FF;
}

.export-period-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.export-dot-active { background: var(--success); }
.export-dot-closed { background: var(--gray-400); }

.export-period-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.export-period-tag {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
}

.export-period-status-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.export-tag-active { background: #DCFCE7; color: #166534; }
.export-tag-closed { background: #F3F4F6; color: #6B7280; }

/* ── Preview info box ── */
.export-preview-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: #F0F9FF;
  border: 1.5px solid #BAE6FD;
  border-radius: 10px;
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}

/* Responsive */
@media (max-width: 500px) {
  .export-scope-group { grid-template-columns: 1fr; }
}

/* ============================================================
   RESPONSIVE OVERHAUL
   Breakpoints:
     ≤1024px  → Tablet landscape / small laptop
     ≤768px   → Tablet portrait / large phone (sidebar slides out)
     ≤480px   → Phone
     ≤360px   → Small phone
   ============================================================ */

/* ── Base: make sure content area never overflows horizontally ── */
.main-content  { min-width: 0; overflow-x: hidden; }
.page-content  { min-width: 0; box-sizing: border-box; }
.card, .card-body, .card-header { min-width: 0; }

/* ── Global table guard: always scrollable ── */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { min-width: 520px; }   /* prevents table cells from squishing too much */

/* ============================================================
   ≤1280px — Large tablet / small laptop
   Tighten sidebar, reduce page padding
   ============================================================ */
@media (max-width: 1280px) {
  :root { --sidebar-width: 240px; }
  .page-content { padding: 20px; }
}

/* ============================================================
   ≤1024px — Tablet landscape
   ============================================================ */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }

  /* Sidebar brand wordmark */
  .brand-wordmark { font-size: 22px; letter-spacing: 4px; }

  /* Page content */
  .page-content { padding: 18px; }

  /* Grids: 2-col stays 2-col but with smaller gap */
  .grid-2 { gap: 14px; }
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 14px; }

  /* Stats grid: min card width smaller */
  .stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

  /* Eval container */
  .eval-container { max-width: 100%; }

  /* Eval header card */
  .eval-header-card { padding: 20px 24px; }

  /* KPI columns: stay 2-col but tighter */
  .kpi-columns-grid { gap: 12px; }

  /* Funnel bar label column narrower */
  .funnel-bar-row { grid-template-columns: 130px 1fr 65px; gap: 10px; }

  /* Monitor search wrapper: allow more width */
  .search-input-wrapper { max-width: none !important; }

  /* Notif panel width */
  .notif-panel { width: 300px; }
}

/* ============================================================
   ≤900px — Tablet portrait (borderline)
   ============================================================ */
@media (max-width: 900px) {
  /* Evaluation status progress bar → compact */
  .eval-status-bar { padding: 14px 16px; gap: 0; }
  .eval-step-label { font-size: 10px; }
  .eval-step-dot   { width: 28px; height: 28px; font-size: 12px; }

  /* KPI header fields: drop to 2 columns */
  .kpi-header-fields { grid-template-columns: 1fr 110px; }

  /* Stat value font smaller on mid screens */
  .stat-value { font-size: 22px; }
}

/* ============================================================
   ≤768px — Tablet portrait / large phone
   Sidebar collapses to off-canvas drawer
   ============================================================ */
@media (max-width: 768px) {
  /* ── Sidebar off-canvas ── */
  :root { --sidebar-width: 260px; }  /* restore full width for drawer */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
  }
  .sidebar-close-btn { display: flex !important; }

  /* ── Main content fills full width ── */
  .main-content { margin-left: 0 !important; width: 100%; }

  /* ── Topbar ── */
  .topbar-menu-btn  { display: flex !important; }
  .topbar-name-text { display: none; }
  .topbar           { padding: 0 16px; }
  .topbar-title     { font-size: 15px; }

  /* Topbar user: hide name, keep avatar */
  .topbar-user span:not(.user-avatar) { display: none; }
  .topbar-user .fa-chevron-down        { display: none; }

  /* ── Page content ── */
  .page-content { padding: 14px; }

  /* ── Login card ── */
  .login-card   { padding: 24px 18px; }
  .brand-wordmark { font-size: 26px; letter-spacing: 5px; }

  /* ── Grids: all go single column ── */
  .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .grid-3 { grid-template-columns: 1fr; gap: 12px; }

  /* ── Stats grid: 2 columns ── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card  { padding: 12px 14px; gap: 10px; }
  .stat-icon  { width: 38px; height: 38px; font-size: 15px; }
  .stat-value { font-size: 20px; }

  /* ── Cards ── */
  .card-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .card-body   { padding: 14px 16px; }
  .card-title  { font-size: 14px; }

  /* ── Page header ── */
  .page-header h1 { font-size: 18px; }
  .page-header p  { font-size: 12px; }

  /* ── Eval container ── */
  .eval-container { max-width: 100%; }
  .eval-header-card { padding: 16px; border-radius: 10px; }
  .eval-header-card h2 { font-size: 16px; }
  .eval-meta-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }

  /* ── Eval status bar → compact vertical-friendly ── */
  .eval-status-bar { padding: 12px 16px; gap: 6px; overflow-x: auto; justify-content: flex-start; }
  .eval-step { flex: 0 0 auto; min-width: 64px; }
  .eval-step::before { display: none; }
  .eval-step-dot   { width: 26px; height: 26px; font-size: 11px; }
  .eval-step-label { font-size: 9px; }

  /* ── Section tab bar ── */
  .section-tab-bar { gap: 2px; padding: 3px; }
  .section-tab     { padding: 7px 10px; font-size: 11px; }

  /* ── KPI columns: single column ── */
  .kpi-columns-grid { grid-template-columns: 1fr; }

  /* ── KPI header fields: stack vertically ── */
  .kpi-header-fields { grid-template-columns: 1fr; }
  .kpi-weight-input-wrapper { max-width: 140px; }

  /* ── Score summary box ── */
  .score-summary-box { flex-direction: column; text-align: center; padding: 16px; }
  .score-summary-value { font-size: 26px; }

  /* ── Monitor filters: wrap and stack ── */
  .monitor-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .search-input-wrapper { grid-column: 1 / -1; max-width: none !important; }
  .filter-select        { width: 100%; }

  /* ── Funnel panel ── */
  .funnel-panel-header  { flex-direction: column; align-items: flex-start; gap: 10px; }
  .funnel-panel-controls { width: 100%; justify-content: space-between; }
  .funnel-period-select  { min-width: 0; width: 100%; max-width: 100%; }
  .funnel-bar-row        { grid-template-columns: 110px 1fr 55px; gap: 8px; }
  .funnel-bar-label      { font-size: 11px; }
  .funnel-stat-pills     { flex-wrap: wrap; }
  .funnel-stat-pill      { flex: 0 0 50%; border-bottom: 1px solid var(--gray-100); }

  /* ── Notification panel ── */
  .notif-panel {
    position: fixed;
    top: var(--topbar-height);
    left: 0; right: 0;
    width: 100%;
    border-radius: 0 0 12px 12px;
    max-height: 70vh;
  }

  /* ── Modal ── */
  .modal { max-width: 100%; margin: 0; border-radius: 14px 14px 0 0; max-height: 92vh; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  /* ── Eval action bar ── */
  .eval-action-bar {
    padding: 12px 16px;
    margin: 20px -14px -14px;
    flex-direction: column;
    gap: 8px;
  }
  .eval-action-bar .btn { width: 100%; justify-content: center; }

  /* ── URL input banner ── */
  .url-input-banner { flex-direction: column; gap: 8px; }
  .url-input-banner input { width: 100%; }

  /* ── HR final score display ── */
  .hr-final-score-display { flex-direction: column; gap: 12px; }
  .hfsd-score { font-size: 36px; }

  /* ── Admin view banner ── */
  .admin-view-banner { flex-direction: column; gap: 8px; font-size: 12px; }

  /* ── Rollback modal header ── */
  .rollback-modal-header { flex-direction: column; align-items: center; text-align: center; gap: 10px; }

  /* ── Indisciplinary row ── */
  .indisc-row { flex-direction: column; align-items: flex-start; }
  .indisc-input-wrap { width: 100%; justify-content: flex-end; }
  .indisc-select, .indisc-input { width: 100% !important; }

  /* ── History hero ── */
  .hist-result-hero  { flex-direction: column; align-items: center; text-align: center; padding: 18px; }
  .hist-result-meta  { justify-content: center; }
  .hist-result-right { flex-direction: row; gap: 16px; }
  .hist-final-banner { flex-direction: column; padding: 14px; }

  /* ── Export modal scope group ── */
  .export-scope-group { grid-template-columns: 1fr; }

  /* ── Period management table ── */
  .utd-pos, .utd-superior { display: none; }
}

/* ============================================================
   ≤480px — Phone
   ============================================================ */
@media (max-width: 480px) {
  /* ── Login ── */
  .login-wrapper  { padding: 16px; }
  .login-card     { padding: 20px 16px; border-radius: 14px; }
  .login-brand    { margin-bottom: 20px; }
  .brand-wordmark { font-size: 22px; letter-spacing: 4px; }

  /* ── Topbar ── */
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar-title { font-size: 14px; }

  /* ── Page content ── */
  .page-content { padding: 10px; }

  /* ── Stats grid: single column on small phones ── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card  { padding: 10px 12px; gap: 8px; }
  .stat-icon  { width: 34px; height: 34px; font-size: 14px; border-radius: 8px; }
  .stat-value { font-size: 18px; }
  .stat-value.stat-value-text { font-size: 11px; }
  .stat-label { font-size: 10px; }

  /* ── Cards ── */
  .card-header { padding: 10px 12px; }
  .card-body   { padding: 12px; }

  /* ── Page header ── */
  .page-header { margin-bottom: 14px; }
  .page-header h1 { font-size: 16px; }

  /* ── Section tab bar: vertical ── */
  .section-tab-bar { flex-direction: column; }
  .section-tab     { text-align: left; }

  /* ── Monitor filters: single column ── */
  .monitor-filters { grid-template-columns: 1fr; }
  .filter-select   { width: 100%; }

  /* ── Funnel bar row ── */
  .funnel-bar-row { grid-template-columns: 90px 1fr 46px; gap: 6px; }
  .funnel-bar-label { font-size: 10px; gap: 4px; }
  .funnel-bar-count { font-size: 13px; }
  .funnel-bar-pct   { display: none; }
  .funnel-period-meta { font-size: 11px; gap: 8px; }

  /* ── Eval steps: horizontal scroll ── */
  .eval-status-bar { gap: 4px; padding: 10px 12px; }
  .eval-step-dot   { width: 24px; height: 24px; font-size: 10px; }
  .eval-step-label { font-size: 8px; }

  /* ── Eval header card ── */
  .eval-header-card { padding: 14px; }
  .eval-meta-grid   { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
  .eval-meta-item p { font-size: 12px; }

  /* ── KPI row ── */
  .kpi-row { padding: 12px; }
  .kpi-row-header { flex-direction: column; gap: 8px; }
  .kpi-weight-pill { align-self: flex-start; }

  /* ── KPI score display ── */
  .kpi-score-display { flex-direction: column; gap: 6px; text-align: center; }
  .kpi-score-display strong { font-size: 22px; }

  /* ── Score summary box ── */
  .score-summary-box { padding: 14px; }
  .score-summary-value { font-size: 22px; }

  /* ── Competency item ── */
  .competency-item { padding: 12px; }

  /* ── Rating stars ── */
  .rating-stars { gap: 4px; flex-wrap: wrap; }
  .rating-star  { width: 28px; height: 28px; font-size: 11px; }

  /* ── Tables in cards ── */
  table { min-width: 400px; }
  thead th { padding: 8px 10px; font-size: 10px; }
  tbody td  { padding: 8px 10px; font-size: 12px; }

  /* ── Alert ── */
  .alert { padding: 8px 12px; font-size: 12px; }

  /* ── Buttons ── */
  .btn    { padding: 8px 14px; font-size: 13px; }
  .btn-sm { padding: 5px 10px; font-size: 11px; }

  /* ── Modal ── */
  .modal-header { padding: 14px 16px; }
  .modal-body   { padding: 14px 16px; }
  .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
  .modal-footer .btn { flex: 1; min-width: 0; justify-content: center; }

  /* ── History hero ── */
  .hist-score-circle { width: 80px; height: 80px; }
  .hist-score-num    { font-size: 22px; }
  .hist-band-grid    { flex-direction: column; }
  .hist-band-item    { width: 100%; }

  /* ── User table ── */
  .utd-dept { display: none; }
  .user-table thead th, .user-table tbody td { padding: 7px 8px; }

  /* ── Rollback timeline ── */
  .rollback-timeline { padding-left: 18px; }
  .rollback-timeline-dot { left: -16px; width: 10px; height: 10px; }
  .rollback-timeline-top { flex-direction: column; }
  .rollback-timeline-date { margin-left: 0; }

  /* ── Toast ── */
  .toast-container { right: 10px; bottom: 10px; left: 10px; }
  .toast           { min-width: 0; width: 100%; }

  /* ── HR final score ── */
  .hfsd-score { font-size: 30px; }
}

/* ============================================================
   ≤360px — Very small phones
   ============================================================ */
@media (max-width: 360px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card  { flex-direction: row; }

  .brand-wordmark { font-size: 20px; letter-spacing: 3px; }
  .login-card     { padding: 16px 12px; }

  .page-content { padding: 8px; }
  .card-body    { padding: 10px; }

  .eval-status-bar { gap: 2px; padding: 8px; }
  .eval-step-label { display: none; }  /* too crowded, hide labels */

  .funnel-bar-row { grid-template-columns: 78px 1fr 40px; gap: 4px; }
  .funnel-bar-label { font-size: 9px; }

  .section-tab-bar .section-tab { font-size: 10px; padding: 6px 8px; }
}

/* ============================================================
   UTILITY — Fluid container for inline styles used in JS
   These override common inline max-width declarations that
   would break on narrow screens
   ============================================================ */

/* Eval form is always full-width on small screens */
@media (max-width: 768px) {
  [style*="max-width:680px"],
  [style*="max-width: 680px"],
  [style*="max-width:960px"],
  [style*="max-width: 960px"] {
    max-width: 100% !important;
  }
  /* Multi-column inline grids → single column */
  [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* Inline search max-width override */
  .search-input-wrapper[style*="max-width"] { max-width: 100% !important; }
}

@media (max-width: 480px) {
  [style*="max-width:680px"],
  [style*="max-width: 680px"],
  [style*="max-width:960px"],
  [style*="max-width: 960px"],
  [style*="max-width:600px"],
  [style*="max-width: 600px"] {
    max-width: 100% !important;
  }
  [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
