:root {
  --sidebar-blue: #12339a;
  --sidebar-blue-dark: #0d2677;
  --sidebar-blue-light: #1d46c1;
  --page-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #eef3ff;
  --text: #182033;
  --text-soft: #5f6b85;
  --border: #d9e1f2;
  --shadow: 0 18px 40px rgba(9, 28, 84, 0.18);
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --sidebar-width: 280px;
  --topbar-height: 68px;
  --content-max: 1440px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* ===== LOGIN PAGE ===== */

.login-page {
  min-height: 100vh;
  background:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.18), transparent 24%),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,0.14), transparent 22%),
    linear-gradient(135deg, #264d99 0%, #1050be 45%, #2c81ea 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-shell {
  width: min(1380px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.login-left {
  color: #fff;
  padding: 24px 8px 24px 8px;
}

.login-badges {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 56px;
}

.login-badge {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.12);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.login-badge img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #fff;
  padding: 6px;
}

.login-hero h1 {
  margin: 0 0 22px;
  font-size: clamp(52px, 6vw, 88px);
  line-height: 0.98;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.login-hero p {
  margin: 0;
  font-size: clamp(22px, 2vw, 34px);
  line-height: 1.45;
  max-width: 720px;
  color: rgba(255,255,255,0.9);
}

.login-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 88px;
}

.login-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.24);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

.login-card-wrap {
  display: flex;
  justify-content: center;
}

.login-card {
  width: min(100%, 520px);
  background: rgba(255,255,255,0.96);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 24px;
  box-shadow: 0 26px 60px rgba(6, 26, 80, 0.22);
  padding: 38px;
}

.login-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 26px;
}

.login-card-header img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  padding: 8px;
  background: #fff8d9;
  border: 1px solid #f0d464;
}

.login-card-header h2 {
  margin: 0 0 4px;
  font-size: 28px;
  color: #1a43b4;
}

.login-card-header p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 600;
}

.login-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: #edf3ff;
  color: #1b4bc5;
  border: 1px solid #d2defd;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.login-card h3 {
  margin: 0 0 18px;
  font-size: 28px;
  line-height: 1.1;
  color: #16203c;
}

.login-card .login-copy {
  margin: 0 0 26px;
  color: #53617c;
  font-size: 18px;
  line-height: 1.55;
}

.microsoft-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid #ccd7ee;
  background: #fff;
  color: #222f4a;
  padding: 18px 20px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.microsoft-button:hover {
  background: #f8fbff;
  box-shadow: 0 10px 20px rgba(14, 36, 96, 0.1);
  transform: translateY(-1px);
}

.microsoft-logo {
  width: 18px;
  height: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.microsoft-logo span:nth-child(1) { background: #f25022; }
.microsoft-logo span:nth-child(2) { background: #7fba00; }
.microsoft-logo span:nth-child(3) { background: #00a4ef; }
.microsoft-logo span:nth-child(4) { background: #ffb900; }

.microsoft-logo span {
  width: 8px;
  height: 8px;
}

.login-note {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 14px;
  background: #eef3fb;
  color: #2b3954;
  border: 1px solid #dae4f6;
  font-weight: 600;
  line-height: 1.5;
}

/* ===== APP LAYOUT ===== */

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  background: var(--page-bg);
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar-blue) 0%, var(--sidebar-blue-dark) 100%);
  color: #fff;
  min-height: 100vh;
  padding: 22px 18px;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 18px;
}

.sidebar-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
}

.sidebar-brand-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.sidebar-brand-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.72);
  margin-top: 4px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-link,
.nav-group-trigger {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  padding: 13px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, transform 120ms ease;
}

.nav-link:hover,
.nav-group-trigger:hover {
  background: rgba(255,255,255,0.12);
}

.nav-link.active,
.nav-group-trigger.active {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-icon {
  width: 20px;
  text-align: center;
  opacity: 0.95;
}

.nav-label {
  font-weight: 700;
  font-size: 15px;
}

.nav-chevron {
  transition: transform 140ms ease;
  color: rgba(255,255,255,0.8);
  font-size: 12px;
}

.nav-group.open .nav-chevron {
  transform: rotate(180deg);
}

.nav-children {
  display: none;
  padding-left: 12px;
  margin-top: 6px;
  margin-bottom: 8px;
  border-left: 1px solid rgba(255,255,255,0.15);
  margin-left: 14px;
}

.nav-group.open .nav-children {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-child {
  display: block;
  padding: 11px 14px;
  border-radius: 10px;
  color: rgba(255,255,255,0.84);
  font-size: 14px;
  font-weight: 600;
}

.nav-child:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.nav-child.active {
  background: rgba(255,255,255,0.16);
  color: #fff;
}

.main {
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-title {
  font-size: 24px;
  font-weight: 800;
  color: #172543;
}

.topbar-subtitle {
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: #edf3ff;
  color: #1f4cc2;
  font-size: 13px;
  font-weight: 800;
}

.content {
  padding: 28px;
}

.page-wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.hero-card {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8ff 100%);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 18px 40px rgba(15, 33, 84, 0.08);
}

.hero-card h1 {
  margin: 0 0 10px;
  font-size: 34px;
  line-height: 1.1;
  color: #15213f;
}

.hero-card p {
  margin: 0;
  color: #5f6b85;
  font-size: 16px;
  line-height: 1.65;
  max-width: 820px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 24px rgba(15, 33, 84, 0.06);
}

.metric-label {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-value {
  margin-top: 12px;
  font-size: 34px;
  line-height: 1;
  font-weight: 800;
  color: #15213f;
}

.metric-sub {
  margin-top: 10px;
  color: #6a7590;
  font-size: 14px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 10px 24px rgba(15, 33, 84, 0.06);
}

.section-card h2 {
  margin: 0 0 10px;
  font-size: 22px;
  color: #172543;
}

.section-card p {
  margin: 0 0 18px;
  color: var(--text-soft);
  line-height: 1.6;
}

.placeholder-list {
  display: grid;
  gap: 12px;
}

.placeholder-item {
  padding: 16px 18px;
  border-radius: 14px;
  background: #f8faff;
  border: 1px solid #e2e9f8;
  color: #32425f;
  font-weight: 600;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.breadcrumb span:last-child {
  color: #1a2644;
}

.empty-state {
  display: grid;
  gap: 18px;
  place-items: start;
  padding: 36px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f7faff 0%, #eef4ff 100%);
  border: 1px dashed #cfdaf1;
}

.empty-state h3 {
  margin: 0;
  font-size: 22px;
  color: #172543;
}

.empty-state p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
  max-width: 760px;
}

.route-badge {
  display: inline-flex;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: #edf3ff;
  color: #1f4cc2;
  border: 1px solid #d5e0fb;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

@media (max-width: 1200px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-left {
    order: 2;
  }

  .login-card-wrap {
    order: 1;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    min-height: auto;
  }

  .content {
    padding: 18px;
  }

  .topbar {
    padding: 0 18px;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .login-page {
    padding: 20px;
  }

  .login-card {
    padding: 28px;
  }

  .login-hero h1 {
    font-size: 52px;
  }

  .login-hero p {
    font-size: 22px;
  }
}

/* ===== HR EMPLOYEES ===== */

.employee-section {
  display: grid;
  gap: 22px;
}

.employee-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.employee-section-heading p {
  margin-bottom: 0;
}

.read-only-badge {
  display: inline-flex;
  align-items: center;
  padding: 9px 13px;
  border-radius: 999px;
  background: #eef3ff;
  border: 1px solid #d4def7;
  color: #1c49bd;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.employee-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, 0.75fr)) auto;
  gap: 14px;
  align-items: end;
}

.employee-toolbar label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.employee-toolbar label > span {
  color: #52617c;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.employee-toolbar input,
.employee-toolbar select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd9ed;
  border-radius: 11px;
  background: #fff;
  color: #172543;
  padding: 10px 12px;
  outline: none;
}

.employee-toolbar input:focus,
.employee-toolbar select:focus {
  border-color: #2d58c7;
  box-shadow: 0 0 0 3px rgba(45, 88, 199, 0.12);
}

.employee-toolbar-actions {
  display: flex;
  gap: 9px;
}

.primary-button,
.secondary-button,
.table-action {
  min-height: 42px;
  border-radius: 10px;
  padding: 9px 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 1px solid #173fae;
  background: #173fae;
  color: #fff;
}

.secondary-button {
  border: 1px solid #cfd9ed;
  background: #fff;
  color: #253653;
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.employee-table-wrap {
  overflow-x: auto;
  border: 1px solid #dce4f2;
  border-radius: 14px;
}

.employee-table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
}

.employee-table th,
.employee-table td {
  padding: 15px 16px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid #e5eaf4;
}

.employee-table th {
  background: #f6f8fd;
  color: #53617b;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.employee-table tbody tr:hover {
  background: #f9fbff;
}

.employee-table tbody tr:last-child td {
  border-bottom: 0;
}

.employee-primary {
  display: grid;
  gap: 3px;
}

.employee-primary strong {
  color: #172543;
}

.employee-primary span,
.employee-primary small,
.table-muted {
  display: block;
  color: #6a7690;
}

.status-badge {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-badge.active {
  background: #e9f8ef;
  color: #17663a;
}

.status-badge.archive {
  background: #f1f3f7;
  color: #5b6579;
}

.table-action {
  border: 1px solid #cdd9f4;
  background: #edf3ff;
  color: #1b49bd;
}

.employee-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 1px dashed #ccd7ea;
  border-radius: 14px;
  background: #fafcff;
  color: #3e4c67;
  text-align: center;
}

.employee-state-error {
  background: #fff8f8;
  border-color: #efcaca;
  color: #8b2828;
}

.employee-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #dbe4f7;
  border-top-color: #1d49bb;
  border-radius: 50%;
  animation: employee-spin 700ms linear infinite;
}

@keyframes employee-spin {
  to {
    transform: rotate(360deg);
  }
}

.employee-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #56647e;
  font-weight: 700;
}

.employee-pagination > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.employee-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(9, 19, 46, 0.48);
  display: flex;
  justify-content: flex-end;
}

.employee-drawer {
  width: min(760px, 100%);
  height: 100%;
  overflow-y: auto;
  background: #fff;
  padding: 30px;
  box-shadow: -24px 0 60px rgba(8, 24, 66, 0.22);
  position: relative;
}

.employee-drawer-close {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid #d8e0ef;
  border-radius: 50%;
  background: #fff;
  color: #263651;
  font-size: 25px;
  cursor: pointer;
}

.employee-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-right: 50px;
  margin-bottom: 24px;
}

.employee-detail-header h2 {
  margin: 13px 0 7px;
  font-size: 27px;
}

.employee-detail-header p {
  margin: 0;
  color: #66728a;
}

.employee-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.employee-detail-grid section,
.employee-contact-section {
  border: 1px solid #dce4f2;
  border-radius: 14px;
  padding: 18px;
}

.employee-detail-grid h3,
.employee-contact-section h3 {
  margin: 0 0 13px;
  color: #172543;
}

.employee-detail-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf0f6;
}

.employee-detail-row:last-child {
  border-bottom: 0;
}

.employee-detail-row span {
  color: #68748b;
}

.employee-detail-row strong {
  color: #22314e;
  overflow-wrap: anywhere;
}

.employee-contact-section {
  margin-top: 18px;
}

.employee-contact-card {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-bottom: 1px solid #edf0f6;
}

.employee-contact-card:last-child {
  border-bottom: 0;
}

.employee-contact-card span {
  color: #66728a;
}

@media (max-width: 1250px) {
  .employee-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-toolbar-actions {
    align-self: end;
  }
}

@media (max-width: 700px) {
  .employee-toolbar,
  .employee-detail-grid {
    grid-template-columns: 1fr;
  }

  .employee-section-heading,
  .employee-pagination,
  .employee-detail-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .employee-drawer {
    padding: 24px 18px;
  }
}

.employee-pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.employee-page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.employee-page-button {
  min-width: 40px;
  height: 40px;
  border: 1px solid #cfd9ed;
  border-radius: 10px;
  background: #fff;
  color: #253653;
  font-weight: 800;
  cursor: pointer;
}

.employee-page-button:hover {
  background: #f3f6fc;
}

.employee-page-button.active {
  border-color: #173fae;
  background: #173fae;
  color: #fff;
}

@media (max-width: 700px) {
  .employee-pagination-controls {
    flex-wrap: wrap;
  }

  .employee-page-numbers {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
}
