 :root {
    --sidebar-bg: #0f172a;
    --sidebar-width: 240px;
    --sidebar-collapsed: 70px;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --accent-green: #22c55e;
    --accent-orange: #f97316;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-teal: #14b8a6;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --topbar-height: 64px;
    --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
  }

  /* ===== SIDEBAR ===== */
  .sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: var(--transition);
    overflow: hidden;
  }
  .sidebar.collapsed { width: var(--sidebar-collapsed); }

  .sidebar-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    min-height: var(--topbar-height);
    text-decoration: none;
  }
  .logo-icon{
    width:42px;
    height:42px;
    border-radius:12px;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
    background:white;
    padding:4px;
}

.logo-icon img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}
  .logo-text {
    font-size: 18px; font-weight: 800; color: white;
    letter-spacing: -0.5px; white-space: nowrap;
    transition: var(--transition);
  }
  .sidebar.collapsed .logo-text { opacity: 0; width: 0; overflow: hidden; }

  .sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
  .sidebar-nav::-webkit-scrollbar { width: 3px; }
  .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

  .nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 18px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    border-radius: 0;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    white-space: nowrap;
    margin: 1px 8px;
    border-radius: 10px;
  }
  .nav-item:hover { color: white; background: rgba(255,255,255,0.07); }
  .nav-item.active {
    color: white;
    background: var(--primary);
    box-shadow: 0 4px 12px rgba(59,130,246,0.35);
  }
  .nav-item .nav-icon { width: 20px; text-align: center; flex-shrink: 0; font-size: 15px; }
  .nav-item .nav-label { font-size: 13.5px; font-weight: 500; transition: var(--transition); }
  .nav-item .nav-arrow { margin-left: auto; font-size: 10px; transition: var(--transition); }
  .sidebar.collapsed .nav-label,
  .sidebar.collapsed .nav-arrow { opacity: 0; width: 0; overflow: hidden; }

  .sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.07);
    display: flex; align-items: center; gap: 10px;
  }
  .user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 13px; flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.15);
  }
  .user-info { transition: var(--transition); white-space: nowrap; overflow: hidden; }
  .user-name { font-size: 13px; font-weight: 600; color: white; }
  .user-role { font-size: 11px; color: rgba(255,255,255,0.5); }
  .sidebar.collapsed .user-info { opacity: 0; width: 0; }

  /* ===== MAIN LAYOUT ===== */
  .main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
  }
  .main-wrapper.expanded { margin-left: var(--sidebar-collapsed); }

  /* ===== TOPBAR ===== */
  .topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px;
    position: sticky; top: 0; z-index: 90;
    box-shadow: var(--shadow-sm);
  }
  .topbar-toggle {
    width: 36px; height: 36px; border: none; background: none;
    cursor: pointer; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); transition: var(--transition);
    flex-shrink: 0;
  }
  .topbar-toggle:hover { background: var(--bg-main); color: var(--text-primary); }

  /* SEARCH BAR */
  .search-wrapper {
    flex: 1; max-width: 480px;
    position: relative;
  }
  .search-input-container {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-main);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 0 12px;
    transition: var(--transition);
  }
  .search-input-container:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
  }
  .search-input-container i { color: var(--text-muted); font-size: 13px; }
  .search-input {
    flex: 1; border: none; background: none; outline: none;
    font-family: inherit; font-size: 13.5px; color: var(--text-primary);
    padding: 9px 0;
  }
  .search-input::placeholder { color: var(--text-muted); }

  .search-dropdown {
    position: absolute; top: calc(100% + 6px); left: 0; right: 0;
    background: white;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    display: none;
    overflow: hidden;
    max-height: 320px;
    overflow-y: auto;
  }
  .search-dropdown.open { display: block; animation: dropDown 0.18s ease; }
  @keyframes dropDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .search-section-label {
    padding: 8px 14px 4px;
    font-size: 10.5px; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.08em;
  }
  .search-result-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 14px; cursor: pointer;
    transition: background 0.12s;
    text-decoration: none; color: var(--text-primary);
  }
  .search-result-item:hover, .search-result-item.focused { background: #f0f7ff; }
  .search-result-item .result-icon {
    width: 30px; height: 30px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; flex-shrink: 0;
  }
  .search-result-item .result-text { font-size: 13.5px; font-weight: 500; }
  .search-result-item .result-desc { font-size: 11.5px; color: var(--text-muted); }
  .search-no-results { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

  .topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .topbar-btn {
    width: 36px; height: 36px; border: none; background: none;
    cursor: pointer; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary); transition: var(--transition);
    position: relative;
  }
  .topbar-btn:hover { background: var(--bg-main); color: var(--text-primary); }
  .notif-badge {
    position: absolute; top: 4px; right: 4px;
    width: 16px; height: 16px; border-radius: 50%;
    background: #ef4444; color: white;
    font-size: 9px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid white;
  }
  .topbar-user {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 30px; cursor: pointer;
    transition: var(--transition);
    border: 1.5px solid var(--border);
  }
  .topbar-user:hover { background: var(--bg-main); }
  .topbar-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 12px;
  }
  .topbar-user-info { display: flex; flex-direction: column; }
  .topbar-user-name { font-size: 12.5px; font-weight: 600; }
  .topbar-user-role { font-size: 10.5px; color: var(--text-muted); }

  /* ===== CONTENT ===== */
  .content { padding: 24px; flex: 1; }

  .page-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 24px;
  }
  .page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
  .page-title span { font-size: 18px; }
  .page-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
  .page-date {
    display: flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text-secondary);
    background: white; border: 1px solid var(--border);
    padding: 6px 12px; border-radius: 8px;
  }

  /* ===== STAT CARDS ===== */
  .stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 22px;
  }
  .stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: flex; align-items: flex-start; gap: 14px;
    transition: var(--transition);
  }
  .stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
  .stat-icon {
    width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; flex-shrink: 0;
  }
  .stat-info { flex: 1; min-width: 0; }
  .stat-label { font-size: 11.5px; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
  .stat-value { font-size: 26px; font-weight: 800; letter-spacing: -1px; line-height: 1; margin-bottom: 5px; }
  .stat-change { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
  .stat-change.up { color: var(--accent-green); }
  .stat-link { font-size: 12px; color: var(--primary); font-weight: 600; cursor: pointer; }

  /* ===== OVERVIEW GRID ===== */
  .overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
  }

  .card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }
  .card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
  }
  .card-title { font-size: 14px; font-weight: 700; }
  .card-action {
    font-size: 11.5px; color: var(--text-muted);
    background: var(--bg-main); border: none; border-radius: 6px;
    padding: 4px 10px; cursor: pointer; font-family: inherit;
    display: flex; align-items: center; gap: 4px;
  }

  /* Donut Charts */
  .donut-wrap { display: flex; align-items: center; gap: 20px; }
  .donut-svg { flex-shrink: 0; }
  .donut-center { font-size: 10px; fill: var(--text-muted); font-family: inherit; font-weight: 500; }
  .donut-center-val { font-size: 20px; fill: var(--text-primary); font-family: inherit; font-weight: 800; }

  .legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
  .legend-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .legend-label { font-size: 12px; color: var(--text-secondary); flex: 1; }
  .legend-value { font-size: 12px; font-weight: 600; }

  /* Payroll */
  .payroll-total { font-size: 26px; font-weight: 800; letter-spacing: -1px; margin: 8px 0 16px; }
  .payroll-row { display: flex; gap: 20px; }
  .payroll-item { flex: 1; }
  .payroll-item-label { font-size: 11px; color: var(--text-secondary); margin-bottom: 4px; }
  .payroll-item-val { font-size: 15px; font-weight: 700; }
  .payroll-icon { width: 36px; height: 36px; background: #dcfce7; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #16a34a; font-size: 16px; }

  /* ===== BOTTOM GRID ===== */
  .bottom-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 22px;
  }

  .list-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
  }
  .list-item:last-child { border-bottom: none; padding-bottom: 0; }
  .list-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 11px; flex-shrink: 0;
  }
  .list-info { flex: 1; min-width: 0; }
  .list-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .list-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .list-date { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
  .view-all { text-align: center; padding-top: 10px; font-size: 12.5px; color: var(--primary); font-weight: 600; cursor: pointer; }

  /* Interview */
  .interview-time { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }

  /* Leave status */
  .status-badge {
    padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 600;
    white-space: nowrap;
  }
  .status-pending { background: #fff7ed; color: #ea580c; }
  .status-approved { background: #f0fdf4; color: #16a34a; }
  .status-rejected { background: #fef2f2; color: #dc2626; }

  /* Performance */
  .perf-score { font-size: 12px; font-weight: 700; white-space: nowrap; }
  .perf-bar-track { flex: 1; height: 5px; background: var(--bg-main); border-radius: 4px; overflow: hidden; }
  .perf-bar-fill { height: 100%; border-radius: 4px; }

  /* ===== QUICK ACTIONS ===== */
  .quick-actions { margin-bottom: 8px; }
  .quick-actions-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
  .quick-grid {
    display: flex; flex-wrap: wrap; gap: 12px;
  }
  .quick-btn {
    display: flex; align-items: center; gap: 9px;
    padding: 10px 18px;
    background: white; border: 1.5px solid var(--border);
    border-radius: 30px; cursor: pointer;
    transition: var(--transition); font-family: inherit;
    font-size: 13px; font-weight: 600; color: var(--text-primary);
  }
  .quick-btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px rgba(59,130,246,0.08); transform: translateY(-1px); }
  .quick-btn .qicon {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; color: white;
  }

  /* ===== MOBILE OVERLAY ===== */
  .sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    backdrop-filter: blur(2px);
  }
  .sidebar-overlay.active { display: block; }

  /* ===== RESPONSIVE ===== */
  @media (max-width: 1200px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
    .overview-grid { grid-template-columns: 1fr 1fr; }
    .bottom-grid { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 900px) {
    :root { --sidebar-width: 240px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
    .main-wrapper { margin-left: 0 !important; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .overview-grid { grid-template-columns: 1fr; }
    .bottom-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar-user-info { display: none; }
  }
  @media (max-width: 600px) {
    .content { padding: 14px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-value { font-size: 20px; }
    .stat-icon { width: 38px; height: 38px; font-size: 15px; }
    .overview-grid, .bottom-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; gap: 8px; }
    .page-date { align-self: flex-start; }
    .search-wrapper { max-width: none; }
    .topbar { gap: 10px; padding: 0 14px; }
    .quick-btn { font-size: 12px; padding: 8px 14px; }
    .payroll-row { flex-direction: column; gap: 10px; }
  }
  @media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr; }
  }

  /* Scroll */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }