/* Blooms Mobility HRMS theme — aligned with bloomsmobility.com */
:root {
  --bm-coral: #fe8464;
  --bm-pink: #fe6e9a;
  --bm-teal: #33c8c1;
  --bm-sky: #119bd2;
  --bm-purple: #2e82ef;
  --bm-blue: #2e82ef;
  --bm-leaf: #509040;
  --bm-text: #2e2e2e;
  --bm-muted: #6a6972;
  --bm-line: #e8eaf0;
  --bm-bg: #f4f6fb;
  --bm-surface: #ffffff;
  --bm-grad-cta: linear-gradient(135deg, #fe8464 0%, #fe6e9a 100%);
  --bm-grad-brand: linear-gradient(160deg, #2a1688 0%, #361cc1 42%, #2e82ef 100%);
  --bm-grad-teal: linear-gradient(135deg, #33c8c1 0%, #119bd2 100%);
  --bm-shadow: 0 8px 24px rgba(54, 28, 193, 0.08);
  --bm-shadow-soft: 0 2px 12px rgba(46, 46, 46, 0.06);
  --bm-radius: 12px;
  --bm-font: 'Lato', system-ui, sans-serif;
  --bm-font-display: 'Poppins', 'Lato', system-ui, sans-serif;
}

html {
  font-size: 15px;
}
body {
  background: var(--bm-bg);
  color: var(--bm-text);
  font-family: var(--bm-font);
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
h5,
h6,
.brand-text,
.page-header h2,
.page-header h3 {
  font-family: var(--bm-font-display);
  color: var(--bm-text);
}
.modal-header.bg-primary h5,
.modal-header.bg-danger h5,
.modal-header.bg-primary .modal-title,
.modal-header.bg-danger .modal-title,
.modal-header.text-white h5 {
  color: #fff !important;
}
a {
  color: var(--bm-purple);
}
a:hover {
  color: var(--bm-pink);
}

/* Bootstrap overrides */
.btn-primary {
  background: var(--bm-grad-cta);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(254, 110, 154, 0.28);
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  background: linear-gradient(135deg, #fe6e9a 0%, #fe8464 100%);
  border: none;
  color: #fff;
  filter: brightness(1.02);
}
.btn-outline-primary {
  color: var(--bm-pink);
  border-color: var(--bm-pink);
  background: transparent;
}
.btn-outline-primary:hover {
  background: var(--bm-grad-cta);
  border-color: transparent;
  color: #fff;
}
.btn-success {
  background: var(--bm-leaf);
  border-color: var(--bm-leaf);
}
.btn-info {
  background: var(--bm-grad-teal);
  border: none;
}
.text-primary {
  color: var(--bm-purple) !important;
}
.bg-primary {
  background: var(--bm-grad-brand) !important;
}
.bg-info {
  background: var(--bm-grad-teal) !important;
}
.border-primary {
  border-color: var(--bm-pink) !important;
}
.badge.bg-primary {
  background: var(--bm-grad-cta) !important;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--bm-pink);
  box-shadow: 0 0 0 0.2rem rgba(254, 110, 154, 0.18);
}
.table th {
  font-family: var(--bm-font-display);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bm-muted);
}
.card {
  border: none;
  border-radius: var(--bm-radius);
  box-shadow: var(--bm-shadow-soft);
  background: var(--bm-surface);
}
.badge {
  padding: 6px 12px;
  font-weight: 600;
}
.btn-sm {
  border-radius: 8px;
}
.page-header {
  margin-bottom: 20px;
}
.stats-card {
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.stats-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bm-shadow);
}

.table-export-btn {
  white-space: nowrap;
}
.table-export-bar {
  background: var(--bs-body-bg, #fff);
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}

/* Layout */
.main-content {
  padding: 20px 28px;
}
.navbar-custom {
  background: var(--bm-surface) !important;
  box-shadow: var(--bm-shadow-soft);
  border-radius: var(--bm-radius);
  padding: 10px 20px;
  margin-bottom: 20px;
  border: 1px solid rgba(54, 28, 193, 0.04);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bm-grad-brand);
  padding: 16px 0 24px;
}
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}
.sidebar .brand {
  color: #fff;
  text-align: center;
  padding: 8px 15px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 12px;
}
.sidebar .brand img {
  width: 48px;
  height: 48px;
  display: block;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  padding: 4px;
}
.sidebar .brand .brand-text {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: #fff;
}
.sidebar .brand .brand-sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  opacity: 0.7;
}

.nav-section {
  margin: 0 0 4px;
}
.nav-section-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 20px);
  margin: 4px 10px 0;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--bm-font-display);
  transition:
    background 0.2s,
    color 0.2s;
}
.nav-section-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
}
.nav-section-toggle .sec-icon {
  font-size: 0.75rem;
}
.nav-section-toggle .sec-title {
  flex: 1;
  text-align: left;
}
.nav-section-toggle .sec-chevron {
  font-size: 0.7rem;
  transition: transform 0.2s;
  opacity: 0.7;
}
.nav-section-toggle[aria-expanded='true'] .sec-chevron {
  transform: rotate(180deg);
}
.nav-section-toggle.has-active {
  color: rgba(255, 255, 255, 0.85);
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.82);
  padding: 8px 14px;
  margin: 1px 10px;
  border-radius: 8px;
  transition: all 0.2s;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}
.sidebar .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
.sidebar .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(254, 132, 100, 0.95), rgba(254, 110, 154, 0.95));
  box-shadow: 0 4px 14px rgba(254, 110, 154, 0.35);
}
.sidebar .nav-link i {
  margin-right: 10px;
  width: 1.1rem;
  text-align: center;
  flex-shrink: 0;
}
.sidebar .nav-link.nav-logout {
  margin-top: 8px;
  opacity: 0.85;
}
.sidebar-version {
  margin-top: 12px;
  padding: 8px 16px 16px;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--bm-font-display);
  user-select: all;
}
.login-version {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  opacity: 0.65;
  font-family: var(--bm-font-display);
  user-select: all;
}

/* Favorites tiles */
.fab-section {
  padding: 0 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 6px;
}
.fab-section .fab-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--bm-font-display);
}
.fab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.fab-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.15;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--bm-font-display);
}
.fab-tile i {
  font-size: 1.15rem;
}
.fab-tile:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  border-color: rgba(254, 132, 100, 0.5);
}
.fab-tile.active {
  background: var(--bm-grad-cta);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(254, 110, 154, 0.4);
}

/* Page navigation loader (sidebar / favorites) */
#pageNavLoader {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 14px;
  background: rgba(244, 246, 251, 0.72);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
#pageNavLoader.is-visible {
  display: flex;
}
#pageNavLoader .page-nav-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(54, 28, 193, 0.15);
  border-top-color: var(--bm-pink);
  border-right-color: var(--bm-purple);
  animation: page-nav-spin 0.75s linear infinite;
}
#pageNavLoader .page-nav-label {
  font-family: var(--bm-font-display);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bm-muted);
  letter-spacing: 0.02em;
}
@keyframes page-nav-spin {
  to {
    transform: rotate(360deg);
  }
}
body.page-nav-loading {
  cursor: progress;
}
body.page-nav-loading .sidebar a.nav-link,
body.page-nav-loading .sidebar a.fab-tile {
  pointer-events: none;
}

/* Bootstrap form validation feedback */
.was-validated .form-control:invalid,
.was-validated .form-select:invalid,
.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545;
}
.was-validated .form-control:valid,
.was-validated .form-select:valid,
.form-control.is-valid,
.form-select.is-valid {
  border-color: #198754;
}
.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.85em;
  color: #dc3545;
}
.was-validated .form-control:invalid ~ .invalid-feedback,
.was-validated .form-select:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback,
.was-validated .input-group:has(.form-control:invalid) ~ .invalid-feedback,
.input-group:has(.form-control.is-invalid) ~ .invalid-feedback,
.was-validated .form-control:invalid + .invalid-feedback,
.form-control.is-invalid + .invalid-feedback {
  display: block;
}

button[type="submit"]:disabled,
input[type="submit"]:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

/* Content tabs — brand underline instead of Bootstrap blue */
.nav-tabs {
  border-bottom: 1px solid var(--bm-line);
  gap: 4px;
}
.nav-tabs .nav-link {
  color: var(--bm-muted);
  font-family: var(--bm-font-display);
  font-weight: 600;
  font-size: 0.9rem;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 10px 16px;
  margin-bottom: -1px;
}
.nav-tabs .nav-link i {
  margin-right: 6px;
}
.nav-tabs .nav-link:hover {
  color: var(--bm-purple);
  isolation: isolate;
  border-color: transparent;
  background: transparent;
}
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
  color: var(--bm-purple);
  background: transparent;
  border-color: transparent;
  border-bottom-color: var(--bm-pink);
}
.nav-tabs .nav-link:focus-visible {
  box-shadow: 0 0 0 0.2rem rgba(254, 110, 154, 0.18);
}
.card-header-tabs {
  margin-bottom: 0;
  border-bottom: 0;
}

/* Segmented tabs — same coral active treatment as sidebar / favorites */
.bm-seg-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin: 0;
  list-style: none;
  background: var(--bm-bg);
  border: 1px solid var(--bm-line);
  border-radius: 10px;
}
.bm-seg-tabs .nav-item {
  margin: 0;
}
.bm-seg-tabs .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--bm-muted);
  font-family: var(--bm-font-display);
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.2;
  padding: 8px 14px;
  border-radius: 8px;
  box-shadow: none;
}
.bm-seg-tabs .nav-link:hover {
  color: var(--bm-purple);
  background: rgba(46, 130, 239, 0.08);
}
.bm-seg-tabs .nav-link.active {
  color: #fff;
  background: var(--bm-grad-cta);
  box-shadow: 0 4px 14px rgba(254, 110, 154, 0.35);
}
.bm-seg-tabs .nav-link.active:hover,
.bm-seg-tabs .nav-link.active:focus {
  color: #fff;
  background: var(--bm-grad-cta);
  filter: brightness(1.02);
}
.bm-seg-tabs .nav-link:focus-visible {
  outline: 2px solid var(--bm-pink);
  outline-offset: 2px;
}
.bm-seg-tabs .badge {
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: 999px;
}
.bm-seg-tabs .nav-link.active .badge {
  background: rgba(255, 255, 255, 0.28) !important;
  color: #fff;
}
