  :root {
    --brand-50:  #EAEDFF;
    --brand-100: #D4DAFC;
    --brand-200: #A8B5F8;
    --brand-300: #7C8FF4;
    --brand-400: #4D63ED;
    --brand-500: #2A40DA;
    --brand-600: #1B2DCC; /* exact logo blue */
    --brand-700: #1525AB;
    --brand-800: #101D87;
    --accent-100: #FDD0D3;
    --accent-300: #F77078;
    --accent-400: #F03C44;
    --accent-500: #ED1C24; /* exact logo red */
    --accent-600: #C71017;
    --accent-700: #9F0B11;
    --bg-page: #F6F8FB;
    --bg-soft: #F1F5F9;
    --surface: #FFFFFF;
    --text-1: #0B1437;
    --text-2: #475569;
    --text-3: #6E7691;
    --border-1: #E5E9F2;
    --border-2: #D5DCE9;
    --shadow-card: 0 1px 2px rgba(12, 22, 104, 0.04), 0 8px 24px -12px rgba(12, 22, 104, 0.10);
    --shadow-card-hover: 0 1px 2px rgba(12, 22, 104, 0.05), 0 16px 36px -14px rgba(12, 22, 104, 0.18);
  }
  * { -webkit-tap-highlight-color: transparent; }
  html, body {
    background: var(--bg-page);
    color: var(--text-1);
    font-family: 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
    min-height: 100vh;
  }

  /* === Soft animated background === */
  .app-bg {
    position: fixed; inset: 0; z-index: 0;
    background:
      radial-gradient(ellipse 70% 50% at 15% 0%, rgba(42, 64, 218, 0.10), transparent 60%),
      radial-gradient(ellipse 60% 45% at 85% 10%, rgba(237, 28, 36, 0.06), transparent 65%),
      linear-gradient(180deg, #F6F8FB 0%, #FFFFFF 50%, #F6F8FB 100%);
    pointer-events: none;
  }
  .app-bg::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
      linear-gradient(rgba(12, 22, 104, 0.025) 1px, transparent 1px),
      linear-gradient(90deg, rgba(12, 22, 104, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 30%, black 30%, transparent 80%);
    opacity: 0.5;
  }
  .orb {
    position: fixed; border-radius: 50%; pointer-events: none;
    filter: blur(90px); opacity: 0.18; z-index: 1;
    animation: float 14s ease-in-out infinite;
  }
  .orb-1 { width: 380px; height: 380px; top: -120px; right: -120px; background: #2A40DA; animation-delay: 0s; }
  .orb-2 { width: 420px; height: 420px; bottom: -140px; left: -160px; background: #1B2DCC; animation-delay: -5s; }
  .orb-3 { width: 280px; height: 280px; top: 45%; left: 55%; background: #ED1C24; opacity: 0.10; animation-delay: -9s; }

  @keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -30px) scale(1.05); }
    66% { transform: translate(-30px, 30px) scale(0.95); }
  }
  @keyframes gradient-x {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }
  @keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(42, 64, 218, 0.25), 0 0 40px rgba(42, 64, 218, 0.08); }
    50% { box-shadow: 0 0 30px rgba(42, 64, 218, 0.45), 0 0 60px rgba(42, 64, 218, 0.18); }
  }
  @keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
  }
  @keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes spin-slow { to { transform: rotate(360deg); } }

  /* === Clean cards (light theme) === */
  .glass {
    background: var(--surface);
    border: 1px solid var(--border-1);
    border-radius: 18px;
    box-shadow: var(--shadow-card);
    position: relative;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }
  .glass:hover { box-shadow: var(--shadow-card-hover); }
  .glass-strong {
    background: var(--surface);
    border-color: var(--border-2);
    box-shadow: var(--shadow-card-hover);
  }
  .glass-soft {
    background: var(--bg-soft);
    border: 1px solid var(--border-1);
    border-radius: 14px;
  }

  /* Inputs */
  .input {
    background: #FFFFFF;
    border: 1px solid var(--border-1);
    border-radius: 12px;
    padding: 11px 14px;
    color: var(--text-1);
    font-size: 14px;
    width: 100%;
    transition: all 0.2s ease;
    outline: none;
  }
  .input::placeholder { color: var(--text-3); opacity: 0.7; }
  .input:focus {
    border-color: var(--brand-600);
    box-shadow: 0 0 0 4px rgba(42, 64, 218, 0.14);
    background: #FFFFFF;
  }
  textarea.input { min-height: 80px; resize: vertical; font-family: inherit; }
  select.input {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230B1437' stroke-width='2' opacity='0.6'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
  }

  /* Buttons */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px; border-radius: 12px; font-weight: 600; font-size: 14px;
    transition: all 0.2s ease; cursor: pointer; white-space: nowrap;
    border: 1px solid transparent; user-select: none;
  }
  .btn-primary {
    background: linear-gradient(135deg, #2A40DA 0%, #1B2DCC 100%);
    color: #FFFFFF;
    box-shadow: 0 8px 24px -10px rgba(27, 45, 204, 0.55), inset 0 1px 0 rgba(255,255,255,0.18);
  }
  .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(27, 45, 204, 0.7), inset 0 1px 0 rgba(255,255,255,0.22); }
  .btn-primary:active { transform: translateY(0); }
  .btn-ghost {
    background: #FFFFFF; color: var(--text-1);
    border-color: var(--border-2);
  }
  .btn-ghost:hover { background: var(--bg-soft); border-color: var(--brand-300); color: var(--brand-700); }
  .btn-danger {
    background: linear-gradient(135deg, #F03C44, #ED1C24);
    color: white;
    box-shadow: 0 8px 24px -10px rgba(237, 28, 36, 0.5), inset 0 1px 0 rgba(255,255,255,0.18);
  }
  .btn-danger:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -10px rgba(237, 28, 36, 0.65); }
  .btn-icon {
    width: 36px; height: 36px; padding: 0; border-radius: 10px;
    background: #FFFFFF; border: 1px solid var(--border-2);
    color: var(--text-2); display: inline-flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; cursor: pointer;
  }
  .btn-icon:hover { background: var(--bg-soft); color: var(--brand-700); border-color: var(--brand-300); }

  /* Sidebar nav */
  .nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 12px; color: var(--text-2);
    font-weight: 500; font-size: 14px; cursor: pointer;
    transition: all 0.2s ease; position: relative; user-select: none;
  }
  .nav-item:hover { background: var(--bg-soft); color: var(--brand-700); }
  .nav-item.active {
    background: linear-gradient(135deg, rgba(42, 64, 218, 0.10), rgba(42, 64, 218, 0.04));
    color: var(--brand-700);
    box-shadow: inset 0 0 0 1px rgba(42, 64, 218, 0.20);
  }
  .nav-item.active::before {
    content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
    width: 4px; height: 22px; border-radius: 4px;
    background: linear-gradient(180deg, #2A40DA, #1B2DCC);
    box-shadow: 0 0 12px rgba(27, 45, 204, 0.4);
  }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 8px; }
  ::-webkit-scrollbar-thumb:hover { background: #B7C0D2; }

  /* Badges */
  .badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: 0.02em; }
  .badge-success { background: #E8F8EF; color: #047857; border: 1px solid #BBE9CC; }
  .badge-warning { background: #FFF6E0; color: #B45309; border: 1px solid #FBE3A6; }
  .badge-danger  { background: #FDE7E8; color: #B91C1C; border: 1px solid #F8BFC2; }
  .badge-info    { background: #E7EEFE; color: #1E40AF; border: 1px solid #C2D2FB; }
  .badge-brand   { background: #E7EEFE; color: var(--brand-700); border: 1px solid #C2D2FB; }
  .badge-accent  { background: #FDE7E8; color: var(--accent-600); border: 1px solid #F8BFC2; }
  .badge-neutral { background: var(--bg-soft); color: var(--text-2); border: 1px solid var(--border-1); }

  /* Tables */
  .data-table { width: 100%; border-collapse: separate; border-spacing: 0; }
  .data-table th {
    text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
    color: var(--text-3); text-transform: uppercase;
    padding: 12px 16px; border-bottom: 1px solid var(--border-1);
    position: sticky; top: 0; background: rgba(255,255,255,0.92); backdrop-filter: blur(8px); z-index: 1;
  }
  .data-table td { padding: 14px 16px; font-size: 14px; border-bottom: 1px solid var(--border-1); color: var(--text-1); }
  .data-table tr:hover td { background: var(--bg-soft); }

  /* Kanban */
  .kanban-col {
    min-width: 300px; max-width: 320px; flex: 1;
  }
  .kanban-card {
    cursor: grab;
    transition: all 0.18s ease;
  }
  .kanban-card:hover { transform: translateY(-2px); border-color: var(--brand-300); box-shadow: var(--shadow-card-hover); }
  .kanban-card.dragging { opacity: 0.5; transform: rotate(2deg); cursor: grabbing; }
  .kanban-col.drag-over { background: rgba(42, 64, 218, 0.06); border-color: var(--brand-400); }

  /* Modal */
  .modal-backdrop {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(11, 20, 55, 0.42); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    animation: fadeInUp 0.2s ease;
  }
  .modal-content {
    width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto;
    animation: fadeInUp 0.3s ease;
  }
  .modal-content.lg { max-width: 920px; }
  .modal-content.xl { max-width: 1200px; }

  /* Toast */
  .toast-container {
    position: fixed; top: 24px; right: 24px; z-index: 200;
    display: flex; flex-direction: column; gap: 12px;
    pointer-events: none;
  }
  .toast {
    pointer-events: auto;
    min-width: 280px; max-width: 380px;
    padding: 14px 16px; border-radius: 14px;
    display: flex; align-items: flex-start; gap: 10px;
    animation: slideInRight 0.3s ease;
  }
  @keyframes slideInRight { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

  /* Loading */
  .spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--border-2);
    border-top-color: var(--brand-600);
    animation: spin-slow 0.7s linear infinite;
  }
  .skeleton {
    background: linear-gradient(90deg, #F1F5F9, #E2E8F0, #F1F5F9);
    background-size: 200% 100%;
    animation: shimmer 1.4s linear infinite;
    border-radius: 8px;
  }

  /* Hide scrollbar for horizontal kanban */
  .kanban-board { overflow-x: auto; padding-bottom: 8px; }
  .kanban-board::-webkit-scrollbar { height: 10px; }

  /* Tooltip */
  [data-tip] { position: relative; }
  [data-tip]:hover::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    padding: 6px 10px; background: var(--text-1); color: #FFFFFF;
    font-size: 12px; border-radius: 8px; white-space: nowrap;
    z-index: 50;
    pointer-events: none;
    box-shadow: 0 8px 24px -8px rgba(11, 20, 55, 0.4);
  }

  /* Login page */
  .login-card {
    background: #FFFFFF;
    border: 1px solid var(--border-1);
    border-radius: 28px;
    padding: 44px;
    box-shadow:
      0 1px 0 rgba(255,255,255,0.6) inset,
      0 30px 60px -25px rgba(12, 22, 104, 0.18),
      0 60px 100px -40px rgba(237, 28, 36, 0.10);
    position: relative;
    overflow: hidden;
  }
  .login-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(42, 64, 218, 0.05) 0%, transparent 40%, transparent 60%, rgba(237, 28, 36, 0.04) 100%);
    pointer-events: none;
  }

  /* Tabs */
  .tabs {
    display: inline-flex; padding: 4px;
    background: var(--bg-soft);
    border: 1px solid var(--border-1);
    border-radius: 14px; gap: 4px;
  }
  .tab {
    padding: 8px 16px; border-radius: 10px; font-size: 13px; font-weight: 600;
    color: var(--text-2); cursor: pointer; transition: all 0.2s ease;
  }
  .tab:hover { color: var(--brand-700); }
  .tab.active {
    background: #FFFFFF;
    color: var(--brand-700);
    box-shadow: 0 1px 2px rgba(12, 22, 104, 0.06), inset 0 0 0 1px rgba(42, 64, 218, 0.18);
  }

  /* Stat card */
  .stat-card {
    padding: 20px 22px;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
  }
  .stat-card .icon-wrap {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(42, 64, 218, 0.10);
    color: var(--brand-600);
    border: 1px solid rgba(42, 64, 218, 0.20);
  }
  .stat-card .stat-trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }

  /* Progress */
  .progress {
    width: 100%; height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden;
    border: 1px solid var(--border-1);
  }
  .progress-fill {
    height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #2A40DA, #1B2DCC);
    transition: width 0.8s cubic-bezier(.4,.0,.2,1);
    position: relative;
  }
  .progress-fill::after {
    content:''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
    background-size: 200% 100%; animation: shimmer 2s linear infinite;
  }

  /* Logo */
  .logo-wrap {
    width: 44px; height: 44px; border-radius: 12px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F1F5F9 100%);
    display: flex; align-items: center; justify-content: center;
    color: #1B2DCC; font-weight: 800; font-family: 'Plus Jakarta Sans';
    box-shadow: 0 6px 18px -8px rgba(27, 45, 204, 0.45), 0 0 0 1px rgba(42, 64, 218, 0.15);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
  }

  /* Avatar */
  .avatar {
    width: 36px; height: 36px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: white;
    flex-shrink: 0;
    background-size: cover; background-position: center;
  }
  .avatar-sm { width: 28px; height: 28px; font-size: 11px; }
  .avatar-lg { width: 56px; height: 56px; font-size: 16px; }

  /* Utility */
  .gradient-text {
    background: linear-gradient(135deg, #2A40DA 0%, #1B2DCC 50%, #ED1C24 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
  .scroll-area { overflow-y: auto; }
  .no-scrollbar::-webkit-scrollbar { display: none; }

  /* Skeleton row */
  .skeleton-row { height: 56px; border-bottom: 1px solid var(--border-1); display: flex; align-items: center; padding: 0 16px; }

  /* Mobile hide */
  @media (max-width: 768px) {
    .desktop-only { display: none; }
  }
  @media (min-width: 769px) {
    .mobile-only { display: none; }
  }

  /* Pretty divider */
  .divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-2), transparent);
    margin: 16px 0;
  }

  /* Chip */
  .chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    background: var(--bg-soft); border: 1px solid var(--border-1);
    font-size: 12px; color: var(--text-2);
  }

  /* Section heading */
  .section-title { font-family: 'Plus Jakarta Sans', Inter, sans-serif; color: var(--text-1); }
  .text-muted { color: var(--text-2); }
  .text-faint { color: var(--text-3); }

  /* ============================================================
     SmartHR-style layout — CSS Grid (bulletproof, no JS race)
     ============================================================ */
  *, *::before, *::after { box-sizing: border-box; }
  html, body {
    width: 100%; max-width: 100vw; margin: 0;
    overflow-x: hidden !important;
  }
  #root { width: 100%; max-width: 100vw; overflow-x: hidden; }
  img, video, canvas, svg { max-width: 100%; height: auto; }
  .recharts-responsive-container { max-width: 100% !important; }

  /* ====================================================================
     LAYOUT — Single source of truth: CSS @media controls visibility
     React renders ALL layout pieces; CSS shows/hides per breakpoint.
     Breakpoint: 1024px (desktop / mobile)
     ==================================================================== */
  .app-shell {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    position: relative;
    overflow-x: clip;
  }
  .main-area {
    grid-column: 2 / 3;
    min-width: 0;          /* CRITICAL: lets grid item shrink */
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding-left: 12px;    /* visual gap from floating sidebar card */
  }
  .page-wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
  }
  .page-wrap > * { flex: 1 0 auto; }

  /* ====================================================================
     DESKTOP SIDEBAR — STABLE state (no hover auto-collapse)
     User clicks toggle to switch between expanded (280px) and collapsed (88px)
     Visually separated with margin gap + own card style
     ==================================================================== */
  .sidebar-desktop-wrap {
    grid-column: 1 / 2;
    align-self: start;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
    width: 88px;                  /* DEFAULT: collapsed rail width */
    transition: width .28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  /* Expanded: grid track grows, content shifts right with smooth animation */
  .sidebar-desktop-wrap.sidebar-expanded { width: 280px; }

  .sidebar-aside {
    width: 100%;
    transition: width .28s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: block;
  }
  /* Sidebar inner card — true float with breathing room */
  .sidebar-card {
    margin: 12px;
    height: calc(100vh - 24px);
    border-radius: 18px;
    border: 1px solid #E5E9F2;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(12, 22, 104, 0.04),
                0 12px 32px -16px rgba(12, 22, 104, 0.10);
    overflow: hidden;
    transition: width .28s cubic-bezier(0.4, 0, 0.2, 1);
  }
  /* In drawer, override card margins */
  .mobile-drawer-wrap .sidebar-card {
    margin: 0 !important;
    height: 100vh !important;
    border-radius: 0 18px 18px 0 !important;
  }
  /* Backwards compat: any old .glass.m-3 inside sidebar should match */
  .sidebar-aside .glass {
    margin: 12px !important;
    margin-right: 0 !important;
  }

  /* Mobile drawer container */
  .mobile-drawer-wrap {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
    width: 280px; max-width: 85vw;
    transform: translateX(-101%); transition: transform .28s ease;
    box-shadow: 0 24px 60px -12px rgba(12, 22, 104, 0.30);
  }
  .mobile-drawer-wrap.open { transform: translateX(0); }
  .mobile-drawer-wrap > aside {
    position: relative !important; transform: none !important;
    width: 100% !important; min-width: 0 !important;
    grid-column: unset !important;
  }
  .mobile-drawer-wrap > aside > div {
    margin: 0 !important; height: 100vh !important;
    border-radius: 0 18px 18px 0 !important;
  }
  .mobile-backdrop {
    position: fixed; inset: 0; background: rgba(11, 20, 55, 0.45);
    backdrop-filter: blur(2px); z-index: 55; opacity: 0; pointer-events: none;
    transition: opacity .25s ease;
  }
  .mobile-backdrop.open { opacity: 1; pointer-events: auto; }

  /* DESKTOP-ONLY (>= 1024px) — show sidebar in flow, hide drawer + menu button */
  @media (min-width: 1024px) {
    .sidebar-desktop-wrap { display: block !important; }
    .mobile-drawer-wrap { display: none !important; }
    .mobile-backdrop { display: none !important; }
    .mobile-menu-btn { display: none !important; }
  }

  /* MOBILE-ONLY (<= 1023px) — hide desktop sidebar + collapse grid; show menu button */
  @media (max-width: 1023px) {
    .app-shell { grid-template-columns: minmax(0, 1fr) !important; }
    .main-area { grid-column: 1 / -1 !important; min-width: 0 !important; width: 100% !important; }
    .sidebar-desktop-wrap { display: none !important; }
    .mobile-drawer-wrap { display: block !important; }
    .mobile-backdrop { display: block !important; }
    .mobile-menu-btn { display: inline-flex !important; }

    .stat-card .text-2xl { font-size: 1.35rem !important; }
    .glass { border-radius: 14px !important; }
    .modal-content { width: calc(100vw - 24px) !important; max-width: calc(100vw - 24px) !important; }
    .tabs { overflow-x: auto; flex-wrap: nowrap !important; -webkit-overflow-scrolling: touch; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab { white-space: nowrap; }
    .kanban-board { overflow-x: auto; padding-bottom: 8px; }
    .kanban-col { min-width: 260px; }
    .data-table th, .data-table td { padding: 8px 10px !important; font-size: 12px !important; }
    .topbar-pad { padding-left: 14px !important; padding-right: 14px !important; }
    .pad-x { padding-left: 14px !important; padding-right: 14px !important; }
  }

  /* TABLET breakpoint (640px - 1023px): finer adjustments */
  @media (min-width: 640px) and (max-width: 1023px) {
    .pad-x { padding-left: 18px !important; padding-right: 18px !important; }
  }

  /* SMALL MOBILE (<= 639px): tighter spacing */
  @media (max-width: 639px) {
    .topbar-pad { gap: 8px !important; padding-top: 14px !important; padding-bottom: 8px !important; }
    .smarthr-card { border-radius: 12px !important; }
    .stat-card { padding: 12px !important; }
    .modal-content { border-radius: 14px !important; }
  }
  @media (max-width: 640px) {
    .topbar-pad h1 { font-size: 1.35rem !important; line-height: 1.2 !important; }
    .topbar-pad p { font-size: 0.78rem !important; }
  }

  /* Adaptive padding helper classes */
  .pad-x { padding-left: clamp(12px, 3vw, 24px); padding-right: clamp(12px, 3vw, 24px); }
  .pad-x-tight { padding-left: clamp(10px, 2.5vw, 16px); padding-right: clamp(10px, 2.5vw, 16px); }

  /* SmartHR-style softer page background + cleaner cards */
  .smarthr-page-bg { background: #F4F6FB; }
  .smarthr-card {
    background: #FFFFFF;
    border: 1px solid #E5EAF2;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px -4px rgba(15, 23, 42, 0.05);
  }

  /* Loader screen */
  #loading-screen {
    position: fixed; inset: 0; background: var(--bg-page); z-index: 999;
    display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 16px;
  }
  .loading-logo {
    width: 64px; height: 64px; border-radius: 16px;
    background: linear-gradient(135deg, #2A40DA, #1B2DCC);
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 900; font-family: 'Plus Jakarta Sans'; font-size: 24px;
    animation: glow 2s ease-in-out infinite;
  }

  /* ====================================================================
     PREMIUM POLISH — v2026.05.10·MF·Polish
     Hover lifts · animated active states · KPI gradients · empty states
     ==================================================================== */

  /* Card hover lift — subtle premium feel */
  .smarthr-card, .glass {
    transition: transform .25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow .25s ease,
                border-color .25s ease;
  }
  .smarthr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04),
                0 12px 28px -8px rgba(27, 45, 204, 0.12),
                0 4px 12px -4px rgba(15, 23, 42, 0.06);
    border-color: #D8E0EE;
  }

  /* Stat / KPI cards — elevated, gradient-edged */
  .stat-card {
    position: relative;
    background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFE 100%);
    border: 1px solid #E5EAF2;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px -4px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow .3s ease;
  }
  .stat-card::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(120% 100% at 100% 0%,
                rgba(42, 64, 218, 0.08) 0%, transparent 60%);
    pointer-events: none; opacity: 0; transition: opacity .3s ease;
  }
  .stat-card::after {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, #2A40DA, #ED1C24);
    border-radius: 0 3px 3px 0;
    opacity: 0; transition: opacity .3s ease;
  }
  .stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.05),
                0 16px 36px -10px rgba(27, 45, 204, 0.18);
  }
  .stat-card:hover::before { opacity: 1; }
  .stat-card:hover::after { opacity: 1; }

  /* ================================================================
     COLLAPSED SIDEBAR (icon rail) — perfectly centered & balanced
     Outer rail = 88px → card margin 12px → card content = 64px
     Every child uses width:100% + flex center for vertical alignment.
     ================================================================ */
  .sidebar-aside.is-collapsed .sidebar-card {
    padding: 14px 0 !important;     /* zero horizontal padding for true centering */
    align-items: stretch;            /* full-width children */
  }

  /* HEADER (logo) — center the logo, hide title text */
  .sidebar-aside.is-collapsed .sidebar-card > div:first-child {
    justify-content: center !important;
    padding: 0 !important;
    margin-bottom: 12px !important;
    gap: 0 !important;
  }
  .sidebar-aside.is-collapsed .logo-wrap {
    margin: 0 auto;
  }

  /* TOGGLE button row — center, separator above nav */
  .sidebar-aside.is-collapsed .sidebar-card > div:nth-child(2) {
    justify-content: center !important;
    padding: 0 !important;
    margin-bottom: 10px !important;
    gap: 0 !important;
  }

  /* NAV — flex column centered */
  .sidebar-aside.is-collapsed nav {
    padding: 0 !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
  }

  /* Each nav-item — perfect square, centered */
  .sidebar-aside.is-collapsed .nav-item {
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    border-radius: 12px;
    flex-shrink: 0;
  }
  .sidebar-aside.is-collapsed .nav-item > svg {
    margin: 0 !important;
  }
  .sidebar-aside.is-collapsed .nav-item.active {
    background: linear-gradient(135deg, rgba(42, 64, 218, 0.12), rgba(42, 64, 218, 0.06));
    box-shadow: inset 0 0 0 1px rgba(42, 64, 218, 0.22);
  }
  /* Active accent indicator — small dot at bottom (not left bar) for collapsed */
  .sidebar-aside.is-collapsed .nav-item.active::before {
    content: ""; position: absolute;
    left: 50% !important; top: auto !important; bottom: 4px !important;
    width: 14px !important; height: 2px !important;
    transform: translateX(-50%) !important;
    background: linear-gradient(90deg, #2A40DA, #ED1C24) !important;
    border-radius: 2px !important;
    box-shadow: none !important;
  }

  /* FOOTER (avatar + logout) — center column */
  .sidebar-aside.is-collapsed .sidebar-card > div:last-child {
    padding-top: 10px !important;
    margin-top: 10px !important;
  }
  .sidebar-aside.is-collapsed .sidebar-card > div:last-child > div {
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
  }

  /* btn-icon inside collapsed rail — sized to match */
  .sidebar-aside.is-collapsed .btn-icon {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Sidebar nav — animated active accent bar */
  .sidebar-aside .nav-item,
  .mobile-drawer-wrap .nav-item {
    position: relative;
    transition: background .2s ease, color .2s ease, padding .2s ease;
  }
  .sidebar-aside .nav-item::before,
  .mobile-drawer-wrap .nav-item::before {
    content: ""; position: absolute; left: 0; top: 50%;
    width: 3px; height: 0;
    background: linear-gradient(180deg, #ED1C24, #2A40DA);
    border-radius: 0 3px 3px 0;
    transform: translateY(-50%);
    transition: height .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .sidebar-aside .nav-item.active::before,
  .mobile-drawer-wrap .nav-item.active::before { height: 60%; }
  .sidebar-aside .nav-item:hover:not(.active),
  .mobile-drawer-wrap .nav-item:hover:not(.active) {
    background: rgba(42, 64, 218, 0.04);
  }

  /* Buttons — premium ripple-like feedback */
  .btn-primary, .btn-accent {
    position: relative; overflow: hidden;
    transition: transform .15s ease, box-shadow .25s ease, filter .2s ease;
  }
  .btn-primary:hover, .btn-accent:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
  }
  .btn-primary:active, .btn-accent:active {
    transform: translateY(0);
    filter: brightness(0.97);
  }

  /* Tabs — smooth active indicator */
  .tab {
    position: relative;
    transition: color .2s ease;
  }
  .tab::after {
    content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px;
    height: 2px; background: linear-gradient(90deg, #2A40DA, #4D63ED);
    border-radius: 2px;
    transform: scaleX(0); transform-origin: center;
    transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .tab.active::after { transform: scaleX(1); }

  /* Topbar — soft glass blur for premium feel */
  .topbar-pad {
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
  }

  /* Pipeline / Kanban columns — subtle elevation */
  .kanban-col {
    transition: box-shadow .25s ease, transform .25s ease;
  }
  .kanban-col:hover {
    box-shadow: 0 6px 18px -6px rgba(15, 23, 42, 0.10);
  }

  /* Table rows — smoother hover */
  .data-table tbody tr {
    transition: background .15s ease, transform .15s ease;
  }
  .data-table tbody tr:hover {
    background: rgba(42, 64, 218, 0.03);
  }

  /* Empty state — premium ring illustration */
  .empty-state-ring {
    width: 96px; height: 96px;
    border-radius: 50%;
    background:
      conic-gradient(from 0deg, #2A40DA 0deg, #4D63ED 90deg, #ED1C24 180deg, #F77078 270deg, #2A40DA 360deg);
    padding: 3px;
    margin: 0 auto 16px;
    animation: spin-slow 12s linear infinite;
  }
  .empty-state-ring > div {
    width: 100%; height: 100%; border-radius: 50%;
    background: #FFFFFF;
    display: flex; align-items: center; justify-content: center;
  }
  @keyframes spin-slow { to { transform: rotate(360deg); } }

  /* Fade-in animation for page enter */
  .page-enter {
    animation: pageEnter .4s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Number tick-up animation hook (apply via class on KPI numbers) */
  .num-tick {
    background: linear-gradient(135deg, #1B2DCC 0%, #2A40DA 50%, #4D63ED 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  /* Avatar — soft ring + scale on hover */
  .avatar-ring {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(42, 64, 218, 0.15);
    transition: box-shadow .2s ease, transform .2s ease;
  }
  .avatar-ring:hover {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px rgba(42, 64, 218, 0.35);
    transform: scale(1.05);
  }

  /* Badge / chip — subtle inner shimmer */
  .chip-premium {
    background: linear-gradient(135deg, #FEF7ED 0%, #FFE7B5 100%);
    color: #92400E;
    border: 1px solid #FDE68A;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
  .chip-diamond {
    background: linear-gradient(135deg, #EAEDFF 0%, #C7D2FE 100%);
    color: #1E3A8A;
    border: 1px solid #C7D2FE;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }

  /* Scrollbar — premium thin style */
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #CBD5E1, #94A3B8);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #94A3B8, #64748B);
    background-clip: padding-box;
    border: 2px solid transparent;
  }

  /* Focus ring — premium accessible look */
  button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid #2A40DA;
    outline-offset: 2px;
    border-radius: 8px;
  }

  /* Modal — better entry animation */
  .modal-content {
    animation: modalIn .35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes modalIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  /* Reduce motion respect */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: .01ms !important;
      transition-duration: .01ms !important;
    }
    .empty-state-ring { animation: none !important; }
  }