@import url("https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.2/css/all.min.css");
@import url("https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* ============================================================
   HR SYSTEM - DESIGN SYSTEM (Clean Light Theme)
   ============================================================ */

/* ── Page transition ─────────────────────────────────────── */
/* Prevent FOUC: hide raw page content until layout shell is ready */
body:not(.layout-ready) #page-body {
  visibility: hidden;
}

.app-shell .main-area {
  opacity: 0;
  transform: translateY(6px) scale(0.998);
  transition:
    opacity 0.14s ease-out,
    transform 0.14s ease-out;
  will-change: opacity, transform;
}

body.layout-ready .app-shell .main-area {
  opacity: 1;
  transform: translateY(0);
}

/* Keep sidebar stable during page switch: fade only main content */
body.page-switching .app-shell .main-area {
  opacity: 0;
  transform: translateY(5px) scale(0.997);
  pointer-events: none;
  transition:
    opacity 0.09s ease-in,
    transform 0.09s ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .app-shell .main-area,
  body.page-switching .app-shell .main-area {
    transition: none !important;
    transform: none !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #0f5fd6;
  --primary-light: #e8f1ff;
  --primary-dark: #0a4cb1;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #c9780e;
  --warning-light: #fffbeb;
  --danger: #d22d2d;
  --danger-light: #fef2f2;
  --info: #0f8aa7;
  --info-light: #ecfeff;

  --bg: #eef3f9;
  --bg-soft: #f6f9ff;
  --surface: #ffffff;
  --border: #dbe5f0;
  --border-dark: #c6d3e3;

  --text: #14263d;
  --text-2: #3f5570;
  --text-3: #8094ad;

  --sidebar-w: 235px;
  --topbar-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow: 0 8px 22px rgba(15, 50, 99, 0.08);
  --shadow-md: 0 16px 40px rgba(15, 50, 99, 0.14);
  --shadow-focus: 0 0 0 4px rgba(15, 95, 214, 0.14);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;

  --font: "Plus Jakarta Sans", "Cairo", "Segoe UI", system-ui, sans-serif;
}

html {
  font-size: 15px;
}
body {
  font-family: var(--font);
  background:
    radial-gradient(
      1200px 500px at 100% -8%,
      rgba(15, 95, 214, 0.09),
      transparent 55%
    ),
    radial-gradient(
      900px 440px at -10% 10%,
      rgba(22, 163, 74, 0.08),
      transparent 58%
    ),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
img {
  max-width: 100%;
  display: block;
}
button {
  cursor: pointer;
  font-family: var(--font);
}

button,
a,
input,
textarea,
select {
  transition:
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}
input,
textarea,
select {
  font-family: var(--font);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 99px;
}

h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1.16rem;
  font-weight: 600;
}
h4 {
  font-size: 1rem;
  font-weight: 600;
}

.text-sm {
  font-size: 0.825rem;
}
.text-xs {
  font-size: 0.75rem;
}
.text-muted {
  color: var(--text-2);
}
.text-danger {
  color: var(--danger);
}
.text-success {
  color: var(--success);
}
.text-warning {
  color: var(--warning);
}
.fw-600 {
  font-weight: 600;
}

.d-flex {
  display: flex;
}
.d-grid {
  display: grid;
}
.d-none {
  display: none !important;
}
.align-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-8 {
  gap: 0.5rem;
}
.gap-12 {
  gap: 0.75rem;
}
.gap-16 {
  gap: 1rem;
}
.gap-24 {
  gap: 1.5rem;
}
.mt-8 {
  margin-top: 0.5rem;
}
.mt-16 {
  margin-top: 1rem;
}
.mt-24 {
  margin-top: 1.5rem;
}
.mb-8 {
  margin-bottom: 0.5rem;
}
.mb-16 {
  margin-bottom: 1rem;
}
.mb-24 {
  margin-bottom: 1.5rem;
}
.w-100 {
  width: 100%;
}
.text-center {
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
