:root {
  --sidebar-bg: #1f1f1f;        /* dark charcoal matching the LinkUp Youth logo */
  --sidebar-hover: #2d2d2d;
  --sidebar-active: #f0a500;    /* orange — logo accent for the active nav item */
  --accent: #f0a500;
  --text-light: #e8e8e8;
  --text-muted: #9a9a9a;
  --body-bg: #f4f6fa;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --danger: #e53e3e;
  --success: #38a169;
  --warning: #d69e2e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: var(--body-bg); color: #2d3748; display: flex; height: 100vh; overflow: hidden; }

/* SIDEBAR */
.sidebar { width: 230px; min-width: 230px; background: var(--sidebar-bg); display: flex; flex-direction: column; height: 100vh; overflow-y: auto; }
.sidebar-logo { padding: 16px 16px 12px; border-bottom: 1px solid rgba(255,255,255,0.08); text-align: center; }
.sidebar-logo .logo-img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.sidebar-logo .brand { font-size: 17px; font-weight: 700; color: #fff; }
.sidebar-logo .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sidebar-logo .accent { color: var(--accent); }
.sidebar nav { padding: 12px 0; flex: 1; }
.nav-group { padding: 8px 16px 4px; font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; color: var(--text-light); text-decoration: none; font-size: 13.5px; transition: background 0.15s; cursor: pointer; }
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.active { background: var(--sidebar-active); color: #1a1a1a; font-weight: 700; }
.nav-item svg { width: 16px; height: 16px; opacity: 0.8; flex-shrink: 0; }
.nav-item.active svg { opacity: 1; }
/* A count on a sidebar link: work waiting for this user somewhere they are not looking. */
.nav-badge { margin-left: auto; min-width: 18px; padding: 1px 6px; border-radius: 9px; background: #e53e3e; color: #fff; font-size: 10.5px; font-weight: 700; text-align: center; line-height: 16px; }
.nav-item.active .nav-badge { background: #1f1f1f; color: #fff; }

/* MAIN */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); padding: 0 24px; height: 52px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.page-title { font-size: 16px; font-weight: 700; color: #1f1f1f; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.content { flex: 1; overflow-y: auto; padding: 20px 24px; }

/* CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.stat-label { font-size: 11px; color: #718096; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 28px; font-weight: 800; color: #1f1f1f; margin-top: 4px; }
.stat-sub { font-size: 12px; color: #718096; margin-top: 2px; }

.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 14px; font-weight: 700; color: #1f1f1f; }
.card-body { padding: 16px 18px; }

/* TABLES */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: #718096; background: #f7fafc; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 9px 12px; border-bottom: 1px solid #f0f4f8; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7fafc; }

/* BADGES */
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge-green { background: #c6f6d5; color: #22543d; }
.badge-red { background: #fed7d7; color: #742a2a; }
.badge-yellow { background: #fefcbf; color: #744210; }
.badge-blue { background: #bee3f8; color: #2a4365; }
.badge-grey { background: #e2e8f0; color: #4a5568; }
.badge-orange { background: #feebc8; color: #7b341e; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: opacity 0.15s; text-decoration: none; }
.btn:hover { opacity: 0.85; }
.btn-primary { background: #1f1f1f; color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-outline { background: #fff; color: #2d3748; border: 1px solid var(--border); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-accent { background: var(--accent); color: #1f1f1f; }

/* FORMS */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-row { margin-bottom: 12px; }
label { display: block; font-size: 12px; font-weight: 600; color: #4a5568; margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 7px 10px; border: 1px solid #cbd5e0; border-radius: 6px; font-size: 13px; background: #fff; color: #2d3748; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #f0a500; box-shadow: 0 0 0 2px rgba(240,165,0,0.20); }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }

/* MODAL */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.open { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 95vw; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.modal-lg { width: 760px; }
.modal-header { padding: 18px 22px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 15px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: #718096; line-height: 1; }
.modal-body { padding: 18px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* TABS */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab { padding: 8px 16px; font-size: 13px; font-weight: 600; color: #718096; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.tab.active { color: #1f1f1f; border-bottom-color: #f0a500; }
.tab:hover:not(.active) { color: #4a5568; }
.tab-count { display: inline-block; margin-left: 6px; padding: 1px 7px; font-size: 11px; font-weight: 700; color: #718096; background: #edf2f7; border-radius: 10px; vertical-align: middle; }
.tab.active .tab-count { color: #ffffff; background: #1f1f1f; }

/* FILTERS */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filter-bar input, .filter-bar select { width: auto; min-width: 150px; }

/* ALERTS */
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 12px; }
.alert-info { background: #ebf8ff; color: #2b6cb0; border: 1px solid #bee3f8; }
.alert-success { background: #f0fff4; color: #276749; border: 1px solid #c6f6d5; }
.alert-danger { background: #fff5f5; color: #c53030; border: 1px solid #fed7d7; }
.alert-warning { background: #fffff0; color: #975a16; border: 1px solid #fefcbf; }

/* MISC */
.text-muted { color: #718096; font-size: 12px; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 16px; }
.flex { display: flex; } .gap-2 { gap: 8px; } .items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.loading { text-align: center; padding: 40px; color: #718096; }
.empty { text-align: center; padding: 40px; color: #718096; font-size: 14px; }

/* Upload drop zone */
.drop-zone { border: 2px dashed #cbd5e0; border-radius: 8px; padding: 32px; text-align: center; color: #718096; cursor: pointer; transition: border-color 0.15s; }
.drop-zone:hover, .drop-zone.dragover { border-color: #f0a500; color: #b87800; }
.drop-zone input[type=file] { display: none; }

/* Amount styling */
.amount { font-family: 'Consolas', monospace; font-size: 13px; }
.amount-credit { color: var(--danger); }
.amount-positive { color: var(--success); }

/* ─── Page polish: shared across Employees / Companies / Programmes / Learnerships ─── */

/* Mini stats strip — 4 hover-lift cards for at-a-glance KPIs at the top of a list page */
.page-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.page-stat { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; transition: transform .12s ease, box-shadow .12s ease; }
.page-stat:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,46,74,.06); }
.page-stat .label { font-size: 12px; color: #718096; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.page-stat .value { font-size: 24px; font-weight: 700; color: #1f1f1f; margin-top: 6px; line-height: 1; }
.page-stat .sub   { font-size: 11px; color: #a0aec0; margin-top: 4px; }
.page-stat.accent-green .value  { color: #276749; }
.page-stat.accent-red   .value  { color: #c53030; }
.page-stat.accent-orange .value { color: #c05621; }
.page-stat.accent-blue  .value  { color: #2b6cb0; }
@media (max-width: 900px) { .page-stats { grid-template-columns: repeat(2, 1fr); } }

/* Avatar with initials — bg colour hashed from name so the same person/company gets a stable colour */
.entity-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.entity-name-cell { display: flex; align-items: center; gap: 10px; }
.entity-name-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.entity-name-text .name { font-weight: 700; color: #1f1f1f; }
.entity-name-text .name a { color: inherit; text-decoration: none; }
.entity-name-text .name a:hover { color: #b87800; }
.entity-name-text .sub { font-size: 11px; color: #a0aec0; }

/* Status pill with a colored leading dot */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.status-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.status-Active     { background: #c6f6d5; color: #276749; }
.status-Active::before     { background: #48bb78; }
.status-Terminated { background: #fed7d7; color: #c53030; }
.status-Terminated::before { background: #f56565; }
.status-NeedsReplacement   { background: #fbd38d; color: #7b341e; }
.status-NeedsReplacement::before   { background: #ed8936; }
.status-Completed  { background: #bee3f8; color: #2b6cb0; }
.status-Completed::before  { background: #4299e1; }
.status-Resigned, .status-Dismissed, .status-Absconded, .status-Dropped, .status-DroppedOff { background: #edf2f7; color: #4a5568; }
.status-Resigned::before, .status-Dismissed::before, .status-Absconded::before, .status-Dropped::before, .status-DroppedOff::before { background: #a0aec0; }

/* Subtle row hover for list tables */
.list-table tr { transition: background .12s ease; }
.list-table tr:hover { background: #f7fafc; }
.list-table td { vertical-align: middle; padding: 10px 12px; }
.list-table .actions { white-space: nowrap; }

/* Skeleton bars while loading */
.skeleton-row td { padding: 14px 12px !important; }
.skeleton-bar { height: 12px; background: linear-gradient(90deg, #edf2f7 0%, #e2e8f0 50%, #edf2f7 100%); background-size: 200% 100%; animation: page-shimmer 1.5s infinite; border-radius: 4px; }
@keyframes page-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Friendly empty state */
.empty-state { text-align: center; padding: 40px 20px; color: #718096; }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; color: #cbd5e0; }
.empty-state .title { font-size: 14px; font-weight: 600; color: #4a5568; margin-bottom: 4px; }
.empty-state .sub { font-size: 12px; color: #a0aec0; }

/* Date-range progress bar (used on Programmes / Learnerships) — visualizes elapsed time */
.daterange { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.daterange .dates { font-size: 12px; color: #4a5568; display: flex; justify-content: space-between; }
.daterange .track { height: 4px; background: #edf2f7; border-radius: 2px; overflow: hidden; }
.daterange .fill  { height: 100%; background: linear-gradient(90deg, #48bb78, #f0a500); border-radius: 2px; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.daterange .fill.expired { background: #cbd5e0; }
.daterange .fill.upcoming { background: #fbd38d; }

/* Small inline chip (for company config flags etc.) */
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; background: #edf2f7; color: #4a5568; margin-right: 4px; }
.chip.blue   { background: #bee3f8; color: #2b6cb0; }
.chip.green  { background: #c6f6d5; color: #276749; }
.chip.orange { background: #fed7aa; color: #7c2d12; }
.chip.red    { background: #fed7d7; color: #c53030; }
.chip.purple { background: #e9d8fd; color: #6b46c1; }

/* Doc-type pills (CN / INV) — same shape as status-pill but tinted to the doc type */
.doc-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: .03em; }
.doc-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.doc-CN  { background: #fed7d7; color: #c53030; }
.doc-CN::before  { background: #f56565; }
.doc-INV { background: #bee3f8; color: #2b6cb0; }
.doc-INV::before { background: #4299e1; }

/* Run-status pill (Draft / Saved / Exported / Imported) */
.run-status { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.run-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }
.run-Draft     { background: #feebc8; color: #9c4221; }
.run-Draft::before     { background: #ed8936; }
.run-Exported  { background: #c6f6d5; color: #276749; }
.run-Exported::before  { background: #48bb78; }
.run-Saved     { background: #bee3f8; color: #2b6cb0; }
.run-Saved::before     { background: #4299e1; }
.run-Imported  { background: #e9d8fd; color: #6b46c1; }
.run-Imported::before  { background: #9f7aea; }

@media (max-width: 768px) {
  .sidebar { width: 52px; min-width: 52px; }
  .nav-item span, .sidebar-logo .sub, .sidebar-logo .brand, .sidebar-logo .logo-img { display: none; }
  .nav-group { display: none; }
  .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
}
