:root {
  --hrms-primary: #7C3AED;
  --hrms-dark: #6D28D9;
  --hrms-accent: #8B5CF6;
  --hrms-light: #F5F3FF;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --cream: #F8FAFC;
  --card: #FFFFFF;
  --line: #E2E8F0;
  --ink: #0F172A;
  --ink-soft: #64748B;
  --nav-h: 64px;
  --header-h: 64px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #CBD5E1;
  color: var(--ink);
  margin: 0;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  margin: 0;
}

#appShell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--cream);
}

/* ── App Header ── */
.app-header {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1020;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--hrms-primary), var(--hrms-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.brand-name {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: white;
  color: var(--hrms-primary);
  border-color: var(--hrms-primary);
}

.avatar-chip {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--hrms-primary);
  color: white;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Profile Dropdown ── */
.profile-dropdown-menu {
  position: absolute;
  top: 48px;
  right: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  width: 240px;
  padding: 14px;
  display: none;
  z-index: 1050;
}

.profile-dropdown-menu.show {
  display: block;
}

/* ── Body Wrapper ── */
.app-body-wrapper {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Desktop Sidebar ── */
.desktop-sidebar {
  width: 240px;
  background: var(--card);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  overflow-y: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 991px) {
  .desktop-sidebar {
    display: none;
  }
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: all 0.15s ease;
}

.sidebar-link:hover {
  background: var(--hrms-light);
  color: var(--hrms-primary);
}

.sidebar-link.active {
  background: var(--hrms-primary);
  color: white;
  font-weight: 600;
}

.sidebar-link i {
  font-size: 1rem;
}

/* ── App Content Area ── */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--cream);
}

/* ── Stat Cards ── */
.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.hrms-stat-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hrms-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.stat-val {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  margin-top: 4px;
}

/* ── Tables & Cards ── */
.data-table-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.table-toolbar {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.table thead th {
  background: var(--cream);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.table tbody td {
  padding: 12px 16px;
  font-size: 0.85rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}

.table tbody tr:hover td {
  background: #F8FAFC;
}

/* ── Badges ── */
.badge-status {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-active { background: #ECFDF5; color: #059669; }
.badge-pending { background: #FFFBEB; color: #D97706; }
.badge-rejected { background: #FEF2F2; color: #DC2626; }
.badge-purple { background: var(--hrms-light); color: var(--hrms-primary); }

/* ── Mobile Bottom Nav ── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--card);
  border-top: 1px solid var(--line);
  justify-content: space-around;
  align-items: center;
  z-index: 1030;
}

@media (max-width: 991px) {
  .bottom-nav.mobile-only {
    display: flex;
  }
  .app-content {
    padding-bottom: 80px;
  }
}

.bottom-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

.bottom-nav .nav-item.active {
  color: var(--hrms-primary);
}

.bottom-nav .nav-item i {
  font-size: 1.15rem;
}

/* ── Bottom Sheet Drawer ── */
.sheet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 1040;
  display: none;
}

.sheet-overlay.show {
  display: block;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  padding: 20px;
  max-height: 85vh;
  overflow-y: auto;
  z-index: 1050;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #CBD5E1;
  margin: 0 auto 16px auto;
}

.sheet-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
}
