/* ============================================================
 * Human Capital — Neumorphic UI Design (v2)
 * Layout: fixed left sidebar + sticky topbar + scrolling content.
 * Color Scheme: 60% Neumorphic White/Soft Gray, 30% Dark Slate, 10% Blue Gradient.
 * ============================================================ */

:root {
  --side-w: 260px;
  --top-h: 60px;
  --bg: #ebf0f6; /* Neumorphic base (soft off-white) */
  --card-bg: #ebf0f6;
  --side-bg: #ebf0f6; /* Neumorphic matching sidebar background */
  --side-fg: #64748b;
  --side-active: linear-gradient(135deg, #004c66 0%, #006699 100%); /* Accent Blue (10%) */
  --text-dark: #0f172a;
  
  /* Neumorphic Shadows */
  --nm-out: 8px 8px 16px #d1d9e6, -8px -8px 16px #ffffff;
  --nm-in: inset 4px 4px 8px #d1d9e6, inset -4px -4px 8px #ffffff;
  --nm-btn-out: 4px 4px 8px #d1d9e6, -4px -4px 8px #ffffff;
  --nm-btn-in: inset 2px 2px 5px #d1d9e6, inset -2px -2px 5px #ffffff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.main {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  margin: 0;
  font-size: 14px;
}

/* ── Left sidebar ─────────────────────────────────────────── */
.left-menu {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--side-w);
  background: var(--side-bg);
  color: var(--side-fg);
  overflow-y: auto;
  z-index: 1030;
  transition: transform .2s ease;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.05);
  border-right: 1px solid rgba(0, 0, 0, 0.03);
}
.left-menu::-webkit-scrollbar { width: 6px; }
.left-menu::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.06); border-radius: 3px; }

.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--side-active);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 10px rgba(0, 76, 102, 0.3);
}
.brand-title { font-size: 16px; font-weight: 700; color: var(--text-dark); }
.brand-sub   { font-size: 11px; color: #64748b; margin-top: 1px; }

.side-nav { padding: 12px 0 24px; }
.nav-section {
  padding: 16px 20px 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: #94a3b8;
}
.side-nav .nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px;
  color: var(--side-fg);
  text-decoration: none;
  font-size: 13px;
  transition: all .2s ease;
  margin: 2px 10px;
  border-radius: 8px;
}
.side-nav .nav-link i { font-size: 15px; opacity: .8; width: 18px; text-align: center; }
.side-nav .nav-link:hover { background: rgba(0, 0, 0, 0.04); color: var(--text-dark); }
.side-nav .nav-link.active {
  background: var(--side-active);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 10px rgba(0, 76, 102, 0.25);
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: var(--side-w); right: 0;
  height: var(--top-h);
  background: rgba(235, 240, 246, 0.15) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
  z-index: 1020;
  display: flex; align-items: center;
  box-shadow: none;
}
.topbar-inner {
  width: 100%;
  padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
}
.topbar-left  { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.page-crumb { font-weight: 700; color: var(--text-dark); text-transform: capitalize; font-size: 15px; }

.user-chip {
  background: var(--card-bg);
  border: none;
  padding: 6px 14px;
  border-radius: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--nm-btn-out);
  cursor: pointer;
  transition: all .2s;
  color: var(--text-dark);
}
.user-chip:hover { box-shadow: var(--nm-btn-in); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 700;
}
.avatar-primary   { background: #004c66; }
.avatar-success   { background: #10b981; }
.avatar-info      { background: #0ea5e9; }
.avatar-secondary { background: #64748b; }
.user-name { font-size: 13px; font-weight: 600; }

/* ── Main content ─────────────────────────────────────────── */
.content {
  margin-left: var(--side-w);
  padding: calc(var(--top-h) + 24px) 24px 60px;
  min-height: 100vh;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-title { font-size: 24px; font-weight: 800; margin: 0; color: var(--text-dark); }
.page-sub   { margin: 4px 0 0; font-size: 12.5px; color: #64748b; }

/* ── Neumorphic Buttons ───────────────────────────────────── */
.btn {
  padding: 8px 18px;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease-in-out;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card-bg);
  color: var(--text-dark);
  box-shadow: var(--nm-btn-out);
}
.btn:hover { box-shadow: var(--nm-btn-in); }
.btn-primary {
  background: var(--side-active);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 76, 102, 0.25);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #00364d 0%, #004c66 100%);
  box-shadow: 0 2px 5px rgba(0, 76, 102, 0.2);
}
.btn-outline-secondary {
  box-shadow: var(--nm-btn-out);
}
.btn-outline-secondary:hover {
  box-shadow: var(--nm-btn-in);
}

/* ── KPI tile (dashboard) ─────────────────────────────────── */
.kpi-card {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 24px;
  background: var(--card-bg);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--nm-out);
  transition: all .2s ease-in-out;
  position: relative;
  overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); }
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; width: 4px;
  background: var(--c, #004c66);
}
.kpi-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: #fff;
  color: var(--c, #004c66);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: var(--nm-btn-in);
}
.kpi-value { font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--text-dark); }
.kpi-label { font-size: 12px; color: #64748b; margin-top: 4px; font-weight: 500; }

/* ── Panels / cards ───────────────────────────────────────── */
.panel {
  background: var(--card-bg);
  border: none;
  border-radius: 20px;
  box-shadow: var(--nm-out);
  overflow: hidden;
  margin-bottom: 24px;
}
.panel .card-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px 24px;
  background: transparent;
}
.panel .table {
  background: transparent;
}
.panel .table-responsive {
  border: none;
}
.x-small { font-size: 10.5px; }

/* ── Footer ───────────────────────────────────────────────── */
.app-footer { margin-left: var(--side-w); padding: 20px 24px; color: #94a3b8; text-align: center; font-size: 12px; }

/* ── Skeleton Loaders ────────────────────────────────────── */
:root {
  --sk-bg: rgba(0, 0, 0, 0.06);
  --sk-bg-pulse: rgba(0, 0, 0, 0.14);
}
body.dark-mode {
  --sk-bg: rgba(255, 255, 255, 0.06);
  --sk-bg-pulse: rgba(255, 255, 255, 0.14);
}
@keyframes skeleton-pulse {
  0% { background-color: var(--sk-bg); }
  50% { background-color: var(--sk-bg-pulse); }
  100% { background-color: var(--sk-bg); }
}
.skeleton-loading .skeleton {
  animation: skeleton-pulse 1.5s infinite ease-in-out;
  border-color: transparent !important;
  color: transparent !important;
  background-color: var(--sk-bg) !important;
  box-shadow: none !important;
  pointer-events: none;
}
.skeleton-loading .skeleton * {
  visibility: hidden !important;
}
.skeleton-text {
  height: 14px;
  border-radius: 4px;
  margin: 6px 0;
  display: inline-block;
  width: 80%;
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}
.skeleton-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-block;
  animation: skeleton-pulse 1.5s infinite ease-in-out;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
  .left-menu { transform: translateX(-100%); }
  body.sidebar-open .left-menu { transform: translateX(0); }
  .topbar, .content, .app-footer { margin-left: 0; left: 0; }
  .topbar { padding-left: 0; }
}

/* ── Glassmorphism & Collapsible States ──────────────── */
.left-menu, .topbar, .content, .app-footer {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.left-menu {
  background: rgba(235, 240, 246, 0.15) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid rgba(255, 255, 255, 0.4);
}

@media (min-width: 993px) {
  body.sidebar-collapsed {
    --side-w: 76px;
  }
  body.sidebar-collapsed .left-menu .brand-logo-container,
  body.sidebar-collapsed .left-menu .nav-link span,
  body.sidebar-collapsed .left-menu .nav-section,
  body.sidebar-collapsed .left-menu .sidebar-footer-text {
    display: none !important;
  }
  body.sidebar-collapsed .left-menu .brand {
    justify-content: center;
    padding: 20px 0;
    border-bottom: none;
  }
  body.sidebar-collapsed .left-menu .side-nav .nav-link {
    justify-content: center;
    padding: 12px 0;
    margin: 4px 10px;
  }
  body.sidebar-collapsed .left-menu .side-nav .nav-link i {
    font-size: 18px;
    margin: 0;
  }
}

/* ── Premium Header Components & Theme Toggles ───────── */
.master-search-container {
  position: relative;
  max-width: 260px;
  width: 100%;
}
.master-search-input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: none;
  border-radius: 12px;
  background: var(--bg);
  box-shadow: var(--nm-in);
  outline: none;
  font-size: 13px;
  transition: all 0.2s;
}
.master-search-input:focus {
  box-shadow: inset 1px 1px 3px #d1d9e6, inset -1px -1px 3px #ffffff, 0 0 0 2px var(--accent-light);
}
.master-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  pointer-events: none;
}

.header-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-bg);
  box-shadow: var(--nm-btn-out);
  border: none;
  cursor: pointer;
  color: #64748b;
  transition: all 0.2s;
  position: relative;
}
.header-action-btn:hover {
  box-shadow: var(--nm-btn-in);
}
.badge-notification {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

/* ── Dark Mode styling ───────────────────────────────── */
body.dark-mode {
  --bg: #1a1a1a;
  --card-bg: #333333;
  --text-dark: #f8fafc;
  --side-bg: #1a1a1a;
  --primary: #f8fafc;
  --nm-out: 8px 8px 16px #0d0d0d, -8px -8px 16px #262626;
  --nm-in: inset 4px 4px 8px #0d0d0d, inset -4px -4px 8px #262626;
  --nm-btn-out: 4px 4px 8px #0d0d0d, -4px -4px 8px #262626;
  --nm-btn-in: inset 2px 2px 5px #0d0d0d, inset -2px -2px 5px #262626;
  --border: rgba(255,255,255,0.05);
}
body.dark-mode .left-menu, body.dark-mode .topbar {
  background: rgba(15, 23, 42, 0.4) !important;
  border-right-color: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
body.dark-mode .brand {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
body.dark-mode .user-chip {
  background: var(--card-bg);
  box-shadow: var(--nm-btn-out);
  color: var(--text-dark);
}
body.dark-mode .user-chip:hover {
  box-shadow: var(--nm-btn-in);
}
body.dark-mode .dropdown-menu {
  background: #1e293b;
  border-color: rgba(255,255,255,0.05);
}
body.dark-mode .dropdown-item {
  color: #f8fafc;
}
body.dark-mode .dropdown-item:hover {
  background: rgba(255,255,255,0.05);
}
body.dark-mode .dropdown-divider {
  border-color: rgba(255,255,255,0.05);
}
body.dark-mode .btn {
  background: var(--card-bg);
  color: var(--text-dark);
}
body.dark-mode .kpi-icon {
  background: #0f172a;
}

/* ── Switch Slider Styles ────────────────────────────── */
.switch input:checked + .slider {
  background-color: var(--accent-light, #006699) !important;
}
.switch .slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.switch input:checked + .slider:before {
  transform: translateX(18px);
}



