@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

:root {
  /* Default Light Theme */
  --primary: #3b82f6;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --danger: #ef4444;
  --surface: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.92);
  --bg-soft: #0f172a; /* This was original, keeping for login page compatibility if needed */
  --text-main: #0f172a;
  --text-muted: #6b7280;
  
  /* Theme Variables */
  --bg-body: #f8fafc;
  --text-body: #334155;
  --bg-container: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --input-bg: #ffffff;
  --header-bg: #ffffff;
  --header-shadow: 0 1px 3px rgba(0,0,0,0.05);
  
  --radius-xl: 24px;
  --radius-lg: 18px;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.28);
  --transition-fast: 180ms ease-out;
}

[data-theme="dark"] {
  --bg-body: #0f172a;
  --text-body: #e2e8f0;
  --bg-container: #1e293b;
  --bg-card: #1e293b;
  --border-color: #334155;
  --input-bg: #334155;
  --header-bg: #1e293b;
  --header-shadow: 0 1px 3px rgba(0,0,0,0.3);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --surface: #1e293b;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text-main);
  background-color: var(--bg-body);
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
}

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background-image: linear-gradient(
      120deg,
      rgba(15, 23, 42, 0.6),
      rgba(30, 64, 175, 0.45)
    ),
    url("ministry.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow-y: auto;
}

.auth-body::-webkit-scrollbar {
  width: 6px;
}

.auth-body::-webkit-scrollbar-thumb {
  background-color: rgba(148, 163, 184, 0.8);
  border-radius: 999px;
}

.auth-shell {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 56px;
}

.auth-brand {
  color: #e5e7eb;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  color: #e5e7eb;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #fb7185);
}

.brand-title {
  margin-top: 18px;
  font-weight: 700;
  font-size: 36px;
  line-height: 1.2;
  color: #f9fafb;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.brand-subtitle {
  margin-top: 12px;
  max-width: 440px;
  font-size: 18px;
  line-height: 1.6;
  color: #cbd5f5;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.brand-metadata {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 20px;
  color: #d1d5db;
}

.brand-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Responsive Styles for Login Page (index.php) */
@media (max-width: 1024px) {
  .auth-shell {
    grid-template-columns: 1fr; /* Stack columns */
    gap: 40px;
    padding: 0 20px;
    max-width: 600px; /* Limit width when stacked */
  }

  .auth-brand {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .brand-pill {
    margin: 0 auto; /* Center the pill */
  }

  .brand-title {
    font-size: 28px;
    margin-top: 16px;
  }

  .brand-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .brand-metadata {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .auth-body {
    padding: 20px 16px;
    /* align-items: flex-start;  Avoid this if it breaks centering vertically on taller screens, but good for short screens */
  }

  .auth-shell {
    gap: 30px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .brand-title {
    font-size: 24px;
  }
  
  .auth-card-title {
      font-size: 22px;
  }
  
  .field-input {
      padding: 12px 16px 12px 38px; /* Adjust padding for smaller screens if needed */
  }
}

.brand-marker {
  width: 14px;
  height: 14px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f97316;
  font-size: 16px;
}

.forgot-panel {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 20px;
  color: var(--text-muted);
  display: none;
}

.forgot-panel.active {
  display: block;
}

.forgot-panel h3 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
  color: #022c22;
}

.forgot-panel p {
  margin: 0 0 8px;
}

.forgot-toggle {
  color: var(--primary-dark);
  font-weight: 500;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.auth-card {
  position: relative;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: var(--radius-xl);
  padding: 28px 28px 30px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.auth-card::before {
  display: none;
}

.auth-card-header {
  margin-bottom: 20px;
}

.auth-card-kicker {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #4b5563;
  margin-bottom: 8px;
  font-weight: 600;
}

.auth-card-title {
  font-size: 26px;
  font-weight: 700;
  color: #1e293b;
  letter-spacing: -0.02em;
}

.auth-card-subtitle {
  margin-top: 8px;
  font-size: 16px;
  color: #475569;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-left: 4px;
}

.field-input-wrap {
  position: relative;
}

.field-input {
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 12px 16px 12px 42px;
  font-size: 16px;
  outline: none;
  background: rgba(255, 255, 255, 0.4);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast), background var(--transition-fast);
}

.field-input::placeholder {
  color: #4b5563;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
  background: rgba(255, 255, 255, 0.85);
}

.field-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  font-size: 16px;
}

.field-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 14px;
  color: #475569;
}

.checkbox-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checkbox-input {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  appearance: none;
  outline: none;
  display: inline-block;
  position: relative;
  background: #f9fafb;
}

.checkbox-input:checked {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
}

.checkbox-input:checked::after {
  content: "";
  position: absolute;
  inset: 3px 2px 2px;
  border-radius: 2px;
  border-right: 2px solid #eff6ff;
  border-bottom: 2px solid #eff6ff;
  transform: rotate(35deg);
}

.link-muted {
  color: var(--primary-dark);
  font-weight: 500;
}

.auth-actions {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-primary {
  width: 100%;
  border-radius: 999px;
  border: none;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #f9fafb;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
  transition: transform var(--transition-fast),
    box-shadow var(--transition-fast), filter var(--transition-fast);
}

.btn-primary span {
  font-size: 16px;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.5);
  filter: brightness(1.03);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.45);
}

.btn-icon-circle {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.4);
  font-size: 18px;
}

.auth-footer {
  margin-top: 20px;
  font-size: 13px;
  color: #64748b;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 16px;
}

.auth-footer span {
  white-space: nowrap;
}

.auth-footer p {
  margin: 0;
}

.auth-footer-legal {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-footer-legal a {
  color: var(--primary-dark);
}

.landing-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.24),
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(248, 113, 113, 0.3),
      transparent 50%
    ),
    linear-gradient(
      125deg,
      rgba(15, 23, 42, 0.94),
      rgba(15, 23, 42, 0.96)
    ),
    url("landing-page.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0.75rem 1.5rem;
  background: var(--header-bg);
  color: var(--text-body);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--header-shadow);
  transition: background-color 0.3s ease, color 0.3s ease;
}

@media (max-width: 768px) {
  .top-nav {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }
  
  .nav-left {
    gap: 10px;
  }
  
  .nav-title {
    font-size: 14px;
    display: none; /* Hide full title on mobile to save space */
  }
  
  .suite-pill {
    font-size: 11px;
    padding: 3px 8px;
  }
}

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

.suite-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.4);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.16em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-body);
}

[data-theme="dark"] .suite-pill {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(129, 140, 248, 0.4);
  color: var(--text-body);
}

.suite-pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.nav-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-body);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.8);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.user-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(22, 163, 74, 0.9);
}

.btn-ghost {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.5);
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast),
    transform var(--transition-fast);
}

.btn-ghost:hover {
  background: rgba(30, 64, 175, 0.85);
  border-color: rgba(129, 140, 248, 1);
  transform: translateY(-1px);
}

.btn-ghost-icon {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.landing-main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 16px 40px 18px;
}

.landing-shell {
  width: 100%;
  max-width: 1180px;
  background: radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.15),
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(236, 72, 153, 0.2),
      transparent 55%
    ),
    var(--surface-muted);
  border-radius: var(--radius-xl);
  padding: 18px 24px 20px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(148, 163, 184, 0.32);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

@media (min-width: 901px) {
  .auth-body {
    overflow-y: hidden;
  }

  .landing-body {
    overflow-y: hidden;
  }

  .landing-title-block h1 {
    font-size: 30px;
  }

  .landing-title-block p {
    font-size: 20px;
  }

  .mode-grid {
    gap: 16px;
  }

  .mode-card {
    min-height: 130px;
  }

  .mode-body {
    font-size: 18px;
  }

  .mode-footer {
    margin-top: 8px;
  }

  .landing-shell {
    padding-bottom: 16px;
  }

  .landing-footer {
    margin-top: 8px;
    font-size: 18px;
  }
}

.landing-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.landing-title-block h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  color: #020617;
}

.landing-title-block p {
  margin: 6px 0 0;
  font-size: 20px;
  color: var(--text-muted);
}

.landing-badge-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  font-size: 18px;
  color: #4b5563;
}

.status-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.08);
  color: #15803d;
  border: 1px solid rgba(22, 163, 74, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.7);
}

.tag-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.06);
  color: #1d4ed8;
  border: 1px dashed rgba(129, 140, 248, 0.7);
}

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

.mode-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #f9fafb;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  position: relative;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.24);
  transform: translateY(0);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    filter var(--transition-fast);
}

.mode-card::before {
  content: "";
  position: absolute;
  inset: -35%;
  background-image: radial-gradient(
      circle at top left,
      rgba(248, 250, 252, 0.28),
      transparent 60%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(15, 23, 42, 0.7),
      transparent 55%
    );
  opacity: 0.9;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.mode-card-inner {
  position: relative;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.mode-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.mode-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-subtitle {
  margin-top: 4px;
  font-size: 20px;
  opacity: 0.9;
}

.mode-icon-circle {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(248, 250, 252, 0.6);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
}

.mode-body {
  margin-top: 12px;
  font-size: 18px;
  line-height: 1.6;
  opacity: 0.92;
}

.mode-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 18px;
}

.mode-button {
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(248, 250, 252, 0.7);
  color: #f9fafb;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.mode-button span {
  font-size: 18px;
}

.mode-button:hover {
  background: #020617;
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.65);
}

.chip-soft {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(248, 250, 252, 0.32);
}

.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 46px rgba(15, 23, 42, 0.5);
  filter: brightness(1.03);
}

.mode-hrm {
  background-image: linear-gradient(135deg, #f97316, #ea580c);
}

.mode-eps {
  background-image: linear-gradient(135deg, #22c55e, #15803d);
}

.mode-pen {
  background-image: linear-gradient(135deg, #a855f7, #7c3aed);
}

.mode-ams {
  background-image: linear-gradient(135deg, #0ea5e9, #0369a1);
}

.mode-epr {
  background-image: linear-gradient(135deg, #ec4899, #db2777);
}

.mode-procurement {
  background-image: linear-gradient(135deg, #6366f1, #4f46e5);
}

.mode-tax {
  background-image: linear-gradient(135deg, #facc15, #eab308);
}

.mode-analytics {
  background-image: linear-gradient(135deg, #f97316, #ec4899);
}

.landing-footer {
  margin-top: 12px;
  font-size: 18px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.landing-footer p {
  margin: 0;
}

.landing-footer span {
  white-space: nowrap;
}

.landing-footer-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.landing-footer-right {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hrm-body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-body);
  color: var(--text-body);
  transition: background-color 0.3s ease, color 0.3s ease;
  position: relative;
  z-index: 0;
}

.hrm-body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(
      circle at top left,
      rgba(59, 130, 246, 0.08),
      transparent 55%
    ),
    radial-gradient(
      circle at bottom right,
      rgba(56, 189, 248, 0.08),
      transparent 60%
    );
    pointer-events: none;
    z-index: -1;
}

.hrm-top-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 30px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  backdrop-filter: blur(12px);
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

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

.hrm-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.hrm-back-link:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--input-bg);
}

.hrm-back-icon {
  font-size: 18px;
}

.hrm-title-block h1 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
}

/* Toast Notification */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: white;
    color: #1e293b;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid #3b82f6;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #22c55e;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

[data-theme="dark"] .toast {
    background: #1e293b;
    color: #f8fafc;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

.hrm-app-pill {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #a5b4fc;
}

.hrm-nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hrm-date-pill {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.8);
  font-size: 14px;
}

.hrm-user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hrm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.hrm-user-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 14px;
}

.hrm-user-name {
  font-weight: 500;
}

.hrm-user-role {
  color: #9ca3af;
}

.hrm-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 26px 40px 40px;
  gap: 20px;
}

.hrm-sub-nav {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding-bottom: 10px;
  overflow-x: auto;
}

/* Sub-tabs for setup pages */
.setup-sub-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.setup-sub-tab:hover {
  color: var(--primary);
}

.setup-sub-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.setup-tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

/* Sub-nav tabs */
.hrm-nav-tab {
  background: transparent;
  border: none;
  padding: 0.5rem 1rem;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hrm-nav-tab:hover {
  color: var(--text-body);
}

.hrm-nav-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.hrm-view {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.hrm-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.hrm-shell {
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hrm-grid {
  display: grid;
  gap: 16px;
}

.hrm-grid--top {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hrm-grid--middle,
.hrm-grid--bottom {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.hrm-grid--modules {
  grid-template-columns: minmax(0, 1fr);
}

.hrm-detail-shell {
  margin-top: 4px;
}

.hrm-detail-card {
  display: none;
}

.hrm-detail-card.active {
  display: block;
}

.hrm-detail-body {
  font-size: 20px;
  color: #e5e7eb;
}

.hrm-detail-body p {
  margin: 0 0 10px;
}

.hrm-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.hrm-detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hrm-detail-field label {
  font-size: 18px;
  color: #cbd5f5;
}

.hrm-detail-field input {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 6px 10px;
  font-size: 20px;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
}

.hrm-staff-toolbar {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.hrm-staff-search input {
  min-width: 220px;
  max-width: 260px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 6px 12px;
  font-size: 20px;
  background: rgba(15, 23, 42, 0.85);
  color: #f9fafb;
}

.hrm-staff-add-btn,
.hrm-staff-save-btn,
.hrm-staff-cancel-btn {
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.9);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  padding: 6px 14px;
  font-size: 20px;
  cursor: pointer;
}

.hrm-staff-cancel-btn {
  border-color: rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.6);
}

.hrm-staff-table {
  width: 100%;
  border-collapse: collapse;
}

.hrm-staff-table th,
.hrm-staff-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    display: flex;
    align-items: center;
    background: #fff;
    color: #333;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    min-width: 300px;
    transform: translateX(120%);
    transition: transform 0.3s ease-in-out;
    border-left: 5px solid #3b82f6;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: #22c55e;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast-message {
    font-weight: 500;
    font-size: 14px;
}

/* Setup Form Styles */
.hrm-form-group { margin-bottom: 1rem; }
.hrm-form-group label { display: block; margin-bottom: 0.5rem; font-size: 13px; font-weight: 500; color: var(--text-muted); }
.hrm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hrm-input, .hrm-select { width: 100%; padding: 10px; border-radius: 6px; background: var(--input-bg); color: var(--text-body); border: 1px solid var(--border-color); font-family: inherit; font-size: 14px; transition: all 0.2s; }
.hrm-input:focus, .hrm-select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }
textarea.hrm-input { resize: vertical; }

/* Responsive Header Utilities - Added for Mobile Compatibility */
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    
    /* Dashboard Header Specifics */
    .top-nav { padding: 0.75rem 1rem !important; }
    .suite-pill { display: none !important; } /* Hide entire suite pill */
    .nav-title { display: none !important; }
    .user-chip { display: none !important; } /* Hide user chip entirely */
    .module-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
    
    /* HRM Header Specifics (Settings & Procurement) */
    .hrm-top-nav { padding: 0 1rem; }
    .hrm-app-pill { display: none; }
    .hrm-title-block h1 { display: none; }
    .hrm-title-block::after { content: attr(data-mobile-title); font-weight: 700; font-size: 1.1rem; color: var(--text-main); }
    .hrm-date-pill { display: none; }
    .hrm-user-name, .hrm-user-meta { display: none !important; } /* Hide user details */
    .hrm-back-link span:not(.hrm-back-icon) { display: none !important; } /* Hide "Back to..." text */
    
    /* Ensure grids stack on mobile */
    .hrm-grid--middle,
    .hrm-grid--bottom,
    .hrm-grid--top {
        grid-template-columns: 1fr !important;
    }
}

/* Responsive Styles for Login Page (index.php) */
@media (max-width: 1024px) {
  .auth-shell {
    grid-template-columns: 1fr; /* Stack columns */
    gap: 40px;
    padding: 0 20px;
    max-width: 600px; /* Limit width when stacked */
  }

  .auth-brand {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .brand-pill {
    margin: 0 auto; /* Center the pill */
  }

  .brand-title {
    font-size: 28px;
    margin-top: 16px;
  }

  .brand-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  
  .brand-metadata {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .auth-body {
    padding: 20px 16px;
    /* align-items: flex-start;  Avoid this if it breaks centering vertically on taller screens, but good for short screens */
  }

  .auth-shell {
    gap: 30px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .brand-title {
    font-size: 24px;
  }
  
  .auth-card-title {
      font-size: 22px;
  }
  
  .field-input {
      padding: 12px 16px 12px 38px; /* Adjust padding for smaller screens if needed */
  }
}
