/* ============================================
   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
   ============================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.content {
  padding: 1.5rem 2rem;
  flex: 1;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid #e2e8f0;
  padding: 1.5rem 1rem;
  flex-shrink: 0;
  min-height: 100vh;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Sidebar Scrollbar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-track {
  background: #f1f5f9;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Sidebar Brand */
.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
}

.sidebar-brand i {
  color: #2563eb;
  font-size: 1.5rem;
}

/* Sidebar User */
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  border: 1px solid #f1f5f9;
}

.sidebar-user .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.sidebar-user .avatar-blue {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
}

.sidebar-user .fw-500 {
  font-weight: 500;
}

.sidebar-user .text-900 {
  color: #0f172a;
}

.sidebar-user .text-500 {
  color: #64748b;
}

.sidebar-user .fs-11 {
  font-size: 0.6875rem;
}

/* Main Navigation */
.sidebar-main-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
  flex: 1;
}

.sidebar-main-nav > li {
  margin-bottom: 0.25rem;
}

.sidebar-main-nav > li > a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-main-nav > li > a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-main-nav > li > a.active {
  background: #2563eb;
  color: #ffffff;
}

.sidebar-main-nav > li > a.active:hover {
  background: #1d4ed8;
}

.sidebar-main-nav > li > a i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

/* Navigation Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex !important;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
}

.nav-dropdown-toggle:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-dropdown-toggle .nav-dropdown-arrow {
  margin-left: auto;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
  color: #94a3b8;
}

.nav-dropdown.open .nav-dropdown-toggle .nav-dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-toggle i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

.nav-dropdown-toggle span {
  flex: 1;
}

/* Dropdown Menu */
.nav-dropdown-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 0.5rem;
}

.nav-dropdown.open .nav-dropdown-menu {
  max-height: 500px;
}

.nav-dropdown-menu li {
  margin-bottom: 0.25rem;
}

.nav-dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  border-radius: 0.5rem;
  color: #475569;
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.nav-dropdown-menu li a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.nav-dropdown-menu li a.active {
  background: #2563eb;
  color: #ffffff;
}

.nav-dropdown-menu li a i {
  font-size: 0.9rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

/* Bottom Navigation */
.sidebar-bottom-nav {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0 0;
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
}

.sidebar-bottom-nav li {
  margin-bottom: 0.25rem;
}

.sidebar-bottom-nav li a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
}

.sidebar-bottom-nav li a:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sidebar-bottom-nav li a.active {
  background: #2563eb;
  color: #ffffff;
}

.sidebar-bottom-nav li a i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
  flex-shrink: 0;
}

/* Navigation Badge */
.nav-badge {
  background: #ef4444;
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.2;
  margin-left: auto;
}

/* Active Indicator */
.nav-active-indicator {
  display: none;
  width: 4px;
  height: 20px;
  background: #ffffff;
  border-radius: 2px;
  flex-shrink: 0;
}

a.active .nav-active-indicator {
  display: block;
}

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

.btn-logout i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.sidebar-version {
  font-size: 0.65rem;
  color: #94a3b8;
  text-align: center;
  padding: 0.5rem 0;
}

/* Mobile Toggle */
.sidebar-mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #0f172a;
  cursor: pointer;
  padding: 0.25rem;
}

/* ============================================
   TOPBAR
   ============================================ */
.topbar {
  background: #ffffff;
  padding: 1rem 2rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.topbar-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #0f172a;
}

.topbar-title p {
  font-size: 0.75rem;
  color: #64748b;
  margin: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-actions .badge-dot {
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  display: inline-block;
}

.topbar-actions .avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
}

/* ============================================
   CARDS
   ============================================ */
.card-custom {
  background: #ffffff;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.15s ease;
}

.card-custom:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ============================================
   KPI CARDS
   ============================================ */
.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.kpi-icon-blue { background: #dbeafe; color: #2563eb; }
.kpi-icon-green { background: #dcfce7; color: #16a34a; }
.kpi-icon-amber { background: #fef3c7; color: #d97706; }
.kpi-icon-cyan { background: #cffafe; color: #0891b2; }

.kpi-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  margin-top: 0.5rem;
}

.kpi-label {
  font-size: 0.875rem;
  color: #64748b;
  font-weight: 500;
}

.kpi-delta {
  font-size: 0.7rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}

/* ============================================
   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; }

/* ============================================
   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 BOX
   ============================================ */
.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; }

/* ============================================
   ATTACH ZONE
   ============================================ */
.attach-zone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  background: #fafafa;
  transition: border-color .15s, background .15s;
  height: 45px;
}

.attach-zone:hover {
  border-color: #93c5fd;
  background: #f0f9ff;
}

.attach-icon {
  width: 28px;
  height: 28px;
  background: #eff6ff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.attach-icon i {
  font-size: 14px;
  color: #2563eb;
}

.attach-text {
  font-size: 12px;
  font-weight: 500;
  color: #334155;
}

/* ============================================
   FILE PREVIEW
   ============================================ */
.file-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.file-preview-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-preview-icon i {
  font-size: 16px;
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-size: 13px;
  font-weight: 500;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 11px;
  color: #94a3b8;
}

.file-preview-remove {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
  transition: color .15s;
}

.file-preview-remove:hover {
  color: #ef4444;
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast-msg {
  background: #1e293b;
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: slideUp 0.25s ease;
}

.toast-msg.success i { color: #34d399; }
.toast-msg.error i { color: #f87171; }
.toast-msg.info i { color: #60a5fa; }

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.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; }
.fw-500 { font-weight: 500 !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
   ============================================ */
@media (max-width: 1200px) {
  .sidebar {
    width: 220px;
  }
}

@media (max-width: 992px) {
  .sidebar {
    width: 200px;
    padding: 1rem 0.75rem;
  }

  .sidebar-main-nav > li > a,
  .nav-dropdown-toggle,
  .sidebar-bottom-nav li a {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }

  .nav-dropdown-menu li a {
    font-size: 0.75rem;
    padding: 0.4rem 0.75rem 0.4rem 2rem;
  }
}

@media (max-width: 768px) {
  .app-wrapper {
    position: relative;
  }

  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 1050;
    transition: left 0.3s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    border-right: none;
    height: 100vh;
    padding: 1.5rem 1rem;
    background: #ffffff;
  }

  .app-wrapper.sidebar-open .sidebar {
    left: 0;
  }

  .app-wrapper.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1040;
  }

  .sidebar-mobile-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
  }

  .topbar {
    padding: 0.75rem 1rem;
  }

  .content {
    padding: 1rem;
  }

  .card-custom {
    padding: 16px !important;
  }

  .table-custom {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .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;
  }

  .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-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  #type-filters,
  .d-flex.flex-wrap.gap-2.mb-4 {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 8px;
  }
}

@media (max-width: 576px) {
  .sidebar {
    width: 100%;
    left: -100%;
  }

  .app-wrapper.sidebar-open .sidebar {
    left: 0;
  }

  .kpi-value {
    font-size: 1.2rem;
  }

  .col-3 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}