/* ==========================================================================
   HR Admin MIS - Executive Royal Blue Theme (Core Design System)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  /* Blue Surfaces Palette */
  --bg-app: #f0f4f9;
  --bg-sidebar: #e8eef8;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-solid: #ffffff;
  --bg-card-hover: #eff6ff;
  --bg-card-subtle: rgba(37, 99, 235, 0.06);
  --bg-input: #ffffff;

  /* Subtle Blue & Slate Borders */
  --border-subtle: rgba(37, 99, 235, 0.16);
  --border-light: rgba(37, 99, 235, 0.28);
  --border-accent: rgba(37, 99, 235, 0.48);

  /* Vibrant & Legible Blue / Slate Typography */
  --text-heading: #1e3a8a;
  --text-primary: #1e293b;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Accent Brand Gradients (Royal Blue to Navy) */
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.35);
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  --gradient-card: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(240, 246, 255, 0.9) 100%);

  /* Workflow Phase Accents harmonized with Blue */
  --phase-project: #0284c7;
  --phase-project-bg: rgba(14, 165, 233, 0.12);
  --phase-recruitment: #2563eb;
  --phase-recruitment-bg: rgba(37, 99, 235, 0.12);
  --phase-interview: #4f46e5;
  --phase-interview-bg: rgba(79, 70, 229, 0.12);
  --phase-selection: #0891b2;
  --phase-selection-bg: rgba(8, 145, 178, 0.12);
  --phase-onboarding: #ea580c;
  --phase-onboarding-bg: rgba(234, 88, 12, 0.12);
  --phase-completion: #059669;
  --phase-completion-bg: rgba(5, 150, 105, 0.12);

  /* Status Colors */
  --success: #059669;
  --warning: #d97706;
  --danger: #e11d48;
  --info: #2563eb;

  /* Spacing & Sizes */
  --sidebar-width: 290px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(30, 58, 138, 0.05);
  --shadow-md: 0 6px 18px rgba(30, 58, 138, 0.08);
  --shadow-lg: 0 14px 32px rgba(30, 58, 138, 0.12);
  --shadow-glow: 0 0 22px rgba(37, 99, 235, 0.28);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scrollbar-gutter: stable;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 88% 82%, rgba(147, 197, 253, 0.18) 0%, transparent 50%),
    linear-gradient(180deg, #f3f7fd 0%, #eaf1fa 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--text-heading);
  letter-spacing: -0.02em;
}

/* App Container Layout */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: transform var(--transition-normal);
  box-shadow: 4px 0 16px rgba(30, 58, 138, 0.05);
  overflow-x: hidden;
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.brand-info h2 {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-heading);
}

.brand-info span {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.85rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
  font-weight: 800;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item a, .nav-item button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  min-width: 0;
  box-sizing: border-box;
}

.nav-item-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  transition: color var(--transition-fast);
}

.nav-item:hover a, .nav-item:hover button {
  color: var(--text-heading);
  background-color: rgba(37, 99, 235, 0.08);
}

.nav-item.active a, .nav-item.active button {
  color: #fff;
  background: var(--gradient-primary);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  border-color: transparent;
}

.nav-item.active .nav-icon {
  color: #fff;
}

.nav-badge {
  font-size: 0.72rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.12);
  color: var(--text-heading);
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* Submenu & Dropdown inside Hiring */
.nav-dropdown-group {
  display: flex;
  flex-direction: column;
}

.nav-dropdown-group .nav-item button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  box-sizing: border-box;
}

.nav-dropdown-group .nav-item:hover button {
  color: var(--text-heading);
  background-color: rgba(37, 99, 235, 0.08);
}

.nav-dropdown-group .nav-item.active button {
  color: #fff;
  background: var(--gradient-primary);
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  border-color: transparent;
}

.nav-dropdown-group .nav-item.active .nav-icon {
  color: #fff !important;
}

.nav-dropdown-group .nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.nav-dropdown-group .nav-item.active .nav-chevron {
  color: #fff !important;
}

.nav-chevron-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.nav-chevron-box:hover {
  background: rgba(37, 99, 235, 0.15);
}

.nav-item.active .nav-chevron-box:hover {
  background: rgba(255, 255, 255, 0.25);
}

.nav-chevron {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(-90deg);
  color: var(--text-muted);
}

.nav-dropdown-group.open .nav-chevron {
  transform: rotate(0deg);
}

.nav-tree {
  margin-left: 1.15rem;
  padding-left: 0.85rem;
  border-left: 2px solid rgba(37, 99, 235, 0.25);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-dropdown-group .nav-tree {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  margin-top: 0;
  border-left-color: transparent;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, margin 0.22s ease, border-color 0.22s ease;
}

.nav-dropdown-group.open .nav-tree {
  max-height: 500px;
  opacity: 1;
  pointer-events: auto;
  margin-top: 0.25rem;
  border-left-color: rgba(37, 99, 235, 0.25);
}

.nav-subitem a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  transition: all var(--transition-fast);
  min-width: 0;
  box-sizing: border-box;
  width: 100%;
}

.nav-subitem a > span:first-child {
  min-width: 0;
}

.nav-subitem a:hover {
  color: var(--text-heading);
  background-color: rgba(37, 99, 235, 0.08);
}

.nav-subitem.active a {
  color: #fff;
  background: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

.nav-subitem.active a .nav-badge {
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(37, 99, 235, 0.04);
}

.user-snippet {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.user-meta h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-heading);
}

.user-meta span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar Header */
.topbar {
  height: var(--header-height);
  background-color: rgba(232, 238, 248, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(30, 58, 138, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-heading);
  font-size: 1.25rem;
  cursor: pointer;
}

.global-search {
  position: relative;
  width: 320px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
}

.global-search input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.3rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-heading);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  transition: all var(--transition-fast);
}

.global-search input::placeholder {
  color: #94a3b8;
}

.global-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.quick-wizard-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all var(--transition-fast);
}

.quick-wizard-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background-color: #ffffff;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-heading);
  background-color: var(--bg-card-hover);
  border-color: var(--primary);
}

.badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--danger);
}

/* Page Content Viewport — same width for all pages (Dashboard, Travel OT, Attendance, etc.) */
.content-area {
  flex: 1;
  padding: 2rem;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  overflow-x: hidden;
}

#view-attendance,
#view-letter-requests,
#view-travel-ot,
#view-leave-management {
  width: 100%;
}


/* Page Header & Visual View Separator */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1.5px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title-wrap h1 {
  font-size: 1.65rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-heading);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Responsive */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .mobile-toggle {
    display: block;
  }
}
