/* ============================================
   AVGC XR Talent Hub — Custom Design System
   Built on Bootstrap 5.3
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --bg-body: #f5f6f8;
  --bg-card: #ffffff;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --sidebar-w: 256px;
  --text-900: #0f172a;
  --text-700: #334155;
  --text-600: #475569;
  --text-500: #64748b;
  --text-400: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  color: var(--text-700);
  margin: 0;
  font-size: 14px;
}

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

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-brand-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1.1;
}

.sidebar-brand-text { line-height: 1.2; }
.sidebar-brand-text .name { font-weight: 600; color: var(--text-900); font-size: 14px; }
.sidebar-brand-text .sub { font-size: 11px; color: var(--text-500); }

.sidebar-user {
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
}

.sidebar-nav { flex: 1; padding: 0 12px; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-600);
  text-decoration: none;
  transition: all .15s;
  margin-bottom: 2px;
}
.sidebar-nav a:hover { background: #f1f5f9; color: var(--text-900); }
.sidebar-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 1px 3px rgba(37,99,235,.3); }
.sidebar-nav a i { font-size: 16px; width: 20px; text-align: center; }

/* ---- Collapsible Nav Group ---- */
.nav-group { margin-bottom: 2px; }

.nav-group-header {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-600);
  background: none;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-transform: none;
}
.nav-group-header:hover { background: #f1f5f9; color: var(--text-900); }

.nav-group-label {
  display: flex; align-items: center; gap: 10px;
}
.nav-group-label i { font-size: 15px; width: 20px; text-align: center; }

.nav-group-arrow {
  font-size: 12px;
  transition: transform .2s ease;
}
.nav-group.open .nav-group-arrow { transform: rotate(90deg); }

/* Highlight the group header when a child is active */
.nav-group.open .nav-group-header {
  color: var(--primary);
}

.nav-group-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .25s ease;
  padding-left: 12px;
}
.nav-group.open .nav-group-body {
  max-height: 500px; /* generous enough to fit up to 5 child items */
}

/* Indent child links inside a group */
.nav-group-body a {
  font-size: 13px;
  padding-left: 20px;
  color: var(--text-600);
  border-left: 2px solid var(--border-light);
  border-radius: 0 8px 8px 0;
  margin-bottom: 1px;
}
.nav-group-body a:hover { border-left-color: #93c5fd; }
.nav-group-body a.active { border-left-color: var(--primary); }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-light);
}
.sidebar-footer button {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-600);
  background: none; border: none; cursor: pointer;
}
.sidebar-footer button:hover { background: #f1f5f9; }

.main-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 32px;
  background: var(--bg-body);
}
.topbar h1 { font-size: 20px; font-weight: 600; color: var(--text-900); margin: 0; }
.topbar .subtitle { font-size: 14px; color: var(--text-500); margin-top: 2px; }

.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-600);
  cursor: pointer;
  font-size: 16px;
}
.icon-btn:hover { background: #f8fafc; }

.content { flex: 1; padding: 0 32px 32px; }

/* ---- Cards ---- */
.card-custom {
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* ---- Avatars ---- */
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}
.avatar-blue { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.avatar-green { background: linear-gradient(135deg, #10b981, #14b8a6); }
.avatar-orange { background: linear-gradient(135deg, #f97316, #f59e0b); }
.avatar-rose { background: linear-gradient(135deg, #f43f5e, #ec4899); }
.avatar-sky { background: linear-gradient(135deg, #0ea5e9, #6366f1); }
.avatar-lime { background: linear-gradient(135deg, #84cc16, #22c55e); }

/* ---- Status Pills ---- */
.pill {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid;
}
.pill-green { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pill-red { background: #fef2f2; color: #be123c; border-color: #fecaca; }
.pill-amber { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pill-blue { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pill-gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.pill-cyan { background: #ecfeff; color: #0e7490; border-color: #a5f3fc; }

/* ---- KPI Cards ---- */
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.kpi-icon-blue { background: #eff6ff; color: #2563eb; }
.kpi-icon-green { background: #ecfdf5; color: #059669; }
.kpi-icon-amber { background: #fffbeb; color: #d97706; }
.kpi-icon-cyan { background: #ecfeff; color: #0891b2; }

.kpi-value { font-size: 24px; font-weight: 600; color: var(--text-900); margin-top: 12px; }
.kpi-label { font-size: 14px; color: var(--text-500); }
.kpi-delta { font-size: 12px; color: var(--text-400); margin-top: 4px; }

/* ---- Tables ---- */
.table-custom { width: 100%; font-size: 14px; }
.table-custom thead th {
  font-size: 12px; font-weight: 500;
  color: var(--text-500);
  border-bottom: 1px solid var(--border);
  padding: 12px 8px;
  text-align: left;
}
.table-custom tbody td {
  padding: 12px 8px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.table-custom tbody tr:hover { background: #f8fafc; }

/* ---- Buttons ---- */
.btn-primary-custom {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary-custom:hover { background: var(--primary-hover); color: #fff; }

.btn-outline-custom {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-600);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-outline-custom:hover { background: #f8fafc; }

/* ---- Filter Pills ---- */
.filter-pill {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-600);
  cursor: pointer;
}
.filter-pill:hover { background: #f8fafc; }
.filter-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---- Search ---- */
.search-box {
  position: relative; flex: 1;
}
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.search-box input:focus { border-color: var(--primary); }
.search-box i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-400); font-size: 14px;
}

/* ---- Headcount Bars ---- */
.hc-bar-track { height: 8px; background: #f1f5f9; border-radius: 99px; overflow: hidden; }
.hc-bar-fill { height: 100%; border-radius: 99px; }
.hc-blue { background: #3b82f6; }
.hc-green { background: #10b981; }
.hc-amber { background: #f59e0b; }
.hc-cyan { background: #06b6d4; }
.hc-rose { background: #f43f5e; }

/* ---- Heatmap ---- */
.heatmap-grid { display: grid; grid-template-columns: repeat(15, 1fr); gap: 6px; }
.heatmap-cell { height: 32px; border-radius: 4px; }

/* ---- Stepper ---- */
.stepper { display: flex; align-items: center; gap: 12px; }
.step-circle {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.step-circle.active { background: var(--primary); color: #fff; }
.step-circle.inactive { background: #f1f5f9; color: var(--text-500); }
.step-line { flex: 1; height: 1px; background: var(--border); }

/* ---- Doc Upload Slot ---- */
.doc-slot {
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
}
.doc-slot:hover { border-color: #93c5fd; background: rgba(37,99,235,.03); }
.doc-slot i { font-size: 24px; color: var(--text-400); margin-bottom: 8px; }

/* ---- Toggle Switch ---- */
.toggle-track {
  width: 36px; height: 20px;
  background: #e2e8f0;
  border-radius: 99px;
  position: relative; cursor: pointer;
}
.toggle-thumb {
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  position: absolute; top: 2px; left: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
  transition: left .15s;
}

/* ---- Availability Dot ---- */
.avail-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.avail-green { background: #10b981; }
.avail-amber { background: #f59e0b; }
.avail-gray { background: #94a3b8; }

/* ---- Public Careers ---- */
.public-hero h1 { font-size: 36px; font-weight: 700; color: var(--text-900); }
.public-hero p { color: var(--text-600); margin-top: 12px; max-width: 640px; }

/* ---- Checklist ---- */
.checklist-item { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.checklist-item.done { color: var(--text-500); text-decoration: line-through; }
.checklist-item i.done { color: #10b981; }
.checklist-item i.pending { color: #cbd5e1; }

/* ---- Misc ---- */
.text-900 { color: var(--text-900) !important; }
.text-700 { color: var(--text-700) !important; }
.text-500 { color: var(--text-500) !important; }
.text-400 { color: var(--text-400) !important; }
.text-primary { color: var(--primary) !important; }
.fw-600 { font-weight: 600 !important; }
.fs-12 { font-size: 12px !important; }
.fs-11 { font-size: 11px !important; }
.fs-24 { font-size: 24px !important; }
.rounded-xl { border-radius: 12px !important; }

/* ============================================
   Responsive Mobile Overrides
   ============================================ */
@media (max-width: 768px) {
  /* Layout */
  .app-wrapper { flex-direction: column; }
  
  /* Off-canvas Sidebar */
  .sidebar { 
    position: fixed; top: 0; left: -100%; 
    height: 100vh; width: 280px; z-index: 1050; 
    border-right: 1px solid var(--border); 
    box-shadow: 10px 0 25px rgba(0,0,0,0.1);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .sidebar.mobile-open { left: 0; }
  .sidebar-nav { max-height: calc(100vh - 150px); overflow-y: auto; }
  
  /* Topbar & Content */
  .topbar { padding: 16px; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
  .topbar h1 { font-size: 18px; }
  .content { padding: 0 16px 16px; }
  
  /* Cards & Tables */
  .card-custom { padding: 16px !important; }
  .table-custom, .p-table { display: block; overflow-x: auto; white-space: nowrap; }
  
  /* Grid overrides (since HTML uses hardcoded .col-3, .col-6 instead of .col-md-X) */
  .col-2, .col-3, .col-4, .col-6, .col-8, .col-9, .col-10 { width: 100% !important; padding-right: 0 !important; padding-left: 0 !important; }
  .row { margin-left: 0 !important; margin-right: 0 !important; }
  
  /* Layout specifics */
  .email-layout { grid-template-columns: 1fr; }
  .tmpl-grid { grid-template-columns: 1fr; }
  .heatmap-grid { overflow-x: auto; padding-bottom: 8px; }
  .stepper { flex-direction: column; align-items: flex-start; }
  .step-line { width: 1px; height: 20px; margin-left: 14px; }
  
  /* Settings Tabs */
  .d-flex.border-bottom { overflow-x: auto; white-space: nowrap; padding-bottom: 4px; }
  
  /* Toolbars and Filters (Mobile fixes) */
  .card-custom > .d-flex.align-items-center.gap-3 { flex-wrap: wrap; }
  .search-box { flex: 1 1 100%; min-width: 100%; margin-bottom: 4px; }
  .btn-outline-custom, .btn-primary-custom { flex: 1; justify-content: center; text-align: center; font-size: 13px; padding: 10px; }
  
  /* Filter Pills (Make them scroll horizontally to save vertical space) */
  #type-filters, .d-flex.flex-wrap.gap-2.mb-4 { flex-wrap: nowrap !important; overflow-x: auto; padding-bottom: 8px; }
  .filter-pill { white-space: nowrap; flex-shrink: 0; }
  
  /* Employee Portal overrides */
  #login-screen .login-card { width: 90%; padding: 32px 24px; }
  .portal-header { padding: 0 16px; height: auto; padding-bottom: 12px; padding-top: 12px; flex-direction: column; gap: 12px; }
  .portal-body { padding: 16px; }
  .portal-tabs { max-width: 100%; overflow-x: auto; }
}
