/* Home: employee wallet card (template layout, midnight tokens). */
.nx-home-ew-live-col {
  display: flex;
}
#js-trigger-home-admin-wrapper .nx-home-admin-equal-row > [class*="col-"].nx-home-ew-live-col > .nx-home-ew-live,
#js-trigger-home-team-wrapper .nx-home-admin-equal-row > [class*="col-"].nx-home-ew-live-col > .nx-home-ew-live {
  flex: 1 1 auto;
  height: 100%;
  min-height: 100%;
}

/* Operator home: same 30px rhythm + equal-height pairs as admin */
#js-trigger-home-team-wrapper .nx-home-top-stats-row,
#js-trigger-home-team-wrapper .nx-home-admin-equal-row {
  margin-bottom: 30px;
}
#js-trigger-home-team-wrapper .nx-home-admin-equal-row:last-child {
  margin-bottom: 0;
}
@media (min-width: 992px) {
  #js-trigger-home-team-wrapper .row.nx-home-admin-equal-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    margin-left: -15px;
    margin-right: -15px;
  }
  #js-trigger-home-team-wrapper .nx-home-admin-equal-row > [class*="col-"] {
    display: flex !important;
    flex-direction: column !important;
    align-self: stretch !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  #js-trigger-home-team-wrapper .nx-home-admin-equal-row > [class*="col-"] > .card {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    margin-bottom: 0 !important;
  }
}
@media (max-width: 991.98px) {
  #js-trigger-home-team-wrapper .nx-home-admin-equal-row > [class*="col-"] > .card {
    margin-bottom: 30px !important;
  }
  #js-trigger-home-team-wrapper .nx-home-admin-equal-row {
    margin-bottom: 0;
  }
}
.nx-home-ew-live {
  --nx-ew-live-delay: var(--delay, 0.35s);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100%;
  padding: 18px 16px 16px;
  text-decoration: none !important;
  color: inherit;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #121212;
  box-shadow:
    0 4px 24px -1px rgba(0, 0, 0, 0.16),
    0 12px 40px -8px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.04);
  animation: nx-home-ew-live-in 0.9s var(--nx-ew-live-delay) both;
  cursor: pointer;
  overflow: hidden;
}
.nx-home-ew-live:hover,
.nx-home-ew-live:focus {
  color: inherit;
  text-decoration: none !important;
}
.nx-home-ew-live__profile {
  position: relative;
  text-align: center;
  margin: 4px auto 14px;
}
.nx-home-ew-live__avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #3d5a80;
  padding: 4px;
  background: #121212;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nx-home-ew-live__avatar--fallback {
  color: rgba(245, 248, 255, 0.72);
  font-size: 32px;
}
.nx-home-ew-live__blobs {
  display: none !important;
}
.nx-home-ew-live__blob {
  position: absolute;
  border-radius: 50%;
  animation: nx-home-ew-live-fly 5.8s linear infinite alternate;
}
.nx-home-ew-live__blob:nth-child(1) {
  width: 14px;
  height: 14px;
  top: 22px;
  left: -18px;
  background: #3d5a80;
  animation-delay: 0.9s;
}
.nx-home-ew-live__blob:nth-child(2) {
  width: 18px;
  height: 18px;
  right: -16px;
  top: -14px;
  background: #87344c;
  animation-delay: 0.2s;
}
.nx-home-ew-live__blob:nth-child(3) {
  width: 12px;
  height: 12px;
  right: -28px;
  top: 52%;
  background: #186e5f;
  animation-delay: 1.8s;
}
.nx-home-ew-live__name {
  margin: 16px 0 6px;
  color: rgba(245, 248, 255, 0.92);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}
.nx-home-ew-live__title {
  font-size: 13px;
  color: rgba(245, 248, 255, 0.55);
}
.nx-home-ew-live__period {
  width: 100%;
  max-width: 240px;
  margin: 10px auto 0;
  position: relative;
  z-index: 4;
}
#nx-home-ew-live .nx-home-ew-live__period .nx-home-select-wrap {
  position: relative !important;
  display: flex !important;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  height: auto;
  line-height: 0;
}
#nx-home-ew-live .nx-home-ew-live__period .nx-home-select-lead-icon,
#nx-home-ew-live .nx-home-ew-live__period .nx-home-select-lead-icon.ph {
  position: absolute !important;
  left: 12px !important;
  top: 0 !important;
  bottom: 0 !important;
  transform: none !important;
  z-index: 5;
  pointer-events: none;
  display: flex !important;
  align-items: center !important;
  justify-content: center;
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  font-family: "Phosphor" !important;
  font-size: 16px !important;
  font-style: normal !important;
  font-weight: normal !important;
  line-height: 1 !important;
  color: rgba(245, 248, 255, 0.88) !important;
}
#nx-home-ew-live .nx-home-ew-live__period .nx-home-select-lead-icon::before {
  font-family: "Phosphor" !important;
  transform: translateY(1px);
}
#nx-home-ew-live .nx-home-ew-live__period .select2-container {
  width: 100% !important;
  min-width: 0;
}
#nx-home-ew-live .nx-home-ew-live__period .select2-container .select2-selection--single .select2-selection__rendered,
#nx-home-ew-live .nx-home-ew-live__period .select2-container--bootstrap .select2-selection--single .select2-selection__rendered,
#nx-home-ew-live .nx-home-ew-live__period .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-left: 36px !important;
  padding-right: 28px !important;
}
#nx-home-ew-live .nx-home-ew-live__period .select2-container .select2-selection--single .select2-selection__clear {
  display: none !important;
}
.select2-dropdown.nx-home-ew-period-drop .select2-search {
  display: none !important;
}
.nx-home-ew-live__cycle-dates {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: rgba(245, 248, 255, 0.48);
}
.nx-home-ew-live__kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-flow: column;
  grid-auto-rows: minmax(0, auto);
  gap: 4px;
  width: 100%;
  max-width: 100%;
  margin: 12px 0 14px;
}
.nx-home-ew-live__kpi {
  --nx-ew-kpi: rgba(245, 248, 255, 0.45);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding: 10px 2px 6px;
  border-radius: 12px;
  text-decoration: none !important;
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.nx-home-ew-live__kpi::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--nx-ew-kpi);
}
.nx-home-ew-live__kpi:hover,
.nx-home-ew-live__kpi:focus {
  color: inherit;
  text-decoration: none !important;
  transform: translateY(-1px);
}
.nx-home-ew-live__kpi--stub {
  cursor: default;
}
.nx-home-ew-live__kpi--stub:hover,
.nx-home-ew-live__kpi--stub:focus {
  transform: none;
}
.nx-home-ew-live__kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--nx-ew-kpi) !important;
}
.nx-home-ew-live__kpi-icon i,
.nx-home-ew-live__kpi-icon .fa-solid,
.nx-home-ew-live__kpi-icon [class^="fa-"] {
  font-size: 13px !important;
  line-height: 1 !important;
  width: 1em !important;
  height: 1em !important;
  color: inherit !important;
}
.nx-home-ew-live__kpi-val {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 2px;
  color: var(--nx-ew-kpi) !important;
}
.nx-home-ew-live__kpi-label {
  margin-top: 3px;
  font-size: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.72;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 1px;
}
.nx-home-ew-live__kpi-norm {
  margin-top: 2px;
  font-size: 8px;
  opacity: 0.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 2px;
}
.nx-home-ew-live__kpi-norm:empty {
  display: none;
}
.nx-home-ew-live__kpi--success {
  --nx-ew-kpi: #24d2b5;
  background: rgba(36, 210, 181, 0.16);
  border-color: rgba(36, 210, 181, 0.38);
}
.nx-home-ew-live__kpi--success .nx-home-ew-live__kpi-icon {
  background: rgba(36, 210, 181, 0.28);
}
.nx-home-ew-live__kpi--warning {
  --nx-ew-kpi: #f0b429;
  background: rgba(240, 180, 41, 0.16);
  border-color: rgba(240, 180, 41, 0.4);
}
.nx-home-ew-live__kpi--warning .nx-home-ew-live__kpi-icon {
  background: rgba(240, 180, 41, 0.28);
}
.nx-home-ew-live__kpi--danger {
  --nx-ew-kpi: #ef415c;
  background: rgba(239, 65, 92, 0.16);
  border-color: rgba(239, 65, 92, 0.4);
}
.nx-home-ew-live__kpi--danger .nx-home-ew-live__kpi-icon {
  background: rgba(239, 65, 92, 0.28);
}
.nx-home-ew-live__kpi--muted {
  --nx-ew-kpi: rgba(245, 248, 255, 0.45);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.nx-home-ew-live__card {
  /* ISO ID-1 / CR80: 85.60 × 53.98 mm */
  --nx-ew-card-ratio: 1.5858;
  position: relative;
  box-sizing: border-box;
  width: min(100%, 292px);
  max-width: 292px;
  aspect-ratio: var(--nx-ew-card-ratio);
  height: auto;
  min-height: 0;
  margin-top: auto;
  margin-left: auto;
  margin-right: auto;
  padding: 18px 18px 14px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  align-self: center;
  overflow: hidden;
  background: radial-gradient(circle at 30% 20%, rgba(39, 44, 51, 0.98) 0%, #16181d 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.3s ease;
}
.nx-home-ew-live:hover .nx-home-ew-live__card {
  transform: scale(1.02);
}
.nx-home-ew-live__card::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  top: 18px;
  left: 38px;
  border-radius: 50%;
  background: #ef415c;
  box-shadow: -14px 0 0 0 #ef8741;
}
.nx-home-ew-live__card::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 4px;
  right: 18px;
  top: 24px;
  border-radius: 4px;
  background:
    radial-gradient(circle, rgba(155, 156, 167, 0.9) 1.6px, transparent 1.8px) 0 0 / 10px 4px repeat-x;
}
.nx-home-ew-live__cash {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.15;
  color: rgba(245, 248, 255, 0.96);
  padding-top: 28px;
  margin-bottom: 4px;
  letter-spacing: 0.01em;
}
.nx-home-ew-live__income {
  font-size: 13px;
  line-height: 1.3;
  color: rgba(245, 248, 255, 0.52);
}
.nx-home-ew-live__due {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.3;
  color: rgba(245, 248, 255, 0.58);
}
.nx-home-ew-live__iban {
  margin-top: auto;
  padding-top: 12px;
  font-weight: 500;
  font-size: 13px;
  line-height: 1.2;
  color: rgba(245, 248, 255, 0.7);
  letter-spacing: 0.04em;
  min-width: 0;
}
.nx-home-ew-live__iban .nx-bank-card-chip {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  flex-wrap: wrap;
}

@keyframes nx-home-ew-live-in {
  0% {
    transform: translateY(-18px);
    opacity: 0;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}
@keyframes nx-home-ew-live-fly {
  40% {
    transform: translate(-6px, -6px);
  }
  60% {
    transform: translate(-12px, -2px);
  }
  100% {
    transform: translate(0, 0);
  }
}

:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live {
  background: #fff;
  border-color: rgba(15, 23, 42, 0.08);
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__name {
  color: #0f172a;
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__title,
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__income {
  color: #64748b;
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__cash {
  color: #0f172a;
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__card {
  background: radial-gradient(circle at 30% 20%, #f8fafc 0%, #eef2f7 100%);
  border-color: rgba(15, 23, 42, 0.08);
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__iban {
  color: #475569;
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__kpi {
  background: #f8fafc;
  border-color: rgba(15, 23, 42, 0.08);
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__kpi-label,
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__kpi-norm {
  color: #64748b;
  opacity: 1;
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__kpi--muted {
  --nx-ew-kpi: #94a3b8;
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__kpi--success {
  --nx-ew-kpi: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.32);
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__kpi--warning {
  --nx-ew-kpi: #d97706;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.32);
}
:is(html.prestige, html[data-bs-theme="prestige"]) .nx-home-ew-live__kpi--danger {
  --nx-ew-kpi: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.32);
}

/* Tablet + phone: stack layout (desktop styles were trapped in unclosed ≥992 media) */
@media (max-width: 991.98px) {
  .nx-home-ew-live-col {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
  }
  /* 30px rhythm like .card — do NOT force display here (tablet grid needs to win) */
  #js-trigger-home-admin-wrapper .nx-home-admin-equal-row > [class*="col-"].nx-home-ew-live-col > .nx-home-ew-live,
  #js-trigger-home-team-wrapper .nx-home-admin-equal-row > [class*="col-"].nx-home-ew-live-col > .nx-home-ew-live,
  .nx-home-ew-live {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-bottom: 30px !important;
    padding: 16px 14px 14px !important;
    overflow: visible !important;
  }
  /* Phone / default ≤991 stack (tablet overrides display below) */
  .nx-home-ew-live {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  .nx-home-ew-live__profile {
    width: 100%;
    margin: 0 auto 12px;
  }
  .nx-home-ew-live__avatar {
    width: 72px !important;
    height: 72px !important;
  }
  .nx-home-ew-live__period {
    max-width: 100%;
  }
  /* Same as desktop: 6 narrow chips in one row */
  .nx-home-ew-live__kpis {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    grid-auto-flow: column !important;
    grid-auto-rows: minmax(0, auto) !important;
    gap: 4px !important;
    margin: 10px 0 12px !important;
    width: 100% !important;
  }
  .nx-home-ew-live__kpi {
    padding: 8px 1px 5px !important;
    min-height: 0 !important;
    border-radius: 10px !important;
  }
  .nx-home-ew-live__kpi-icon {
    width: 24px !important;
    height: 24px !important;
    margin-bottom: 4px !important;
  }
  .nx-home-ew-live__kpi-val {
    font-size: 11px !important;
    white-space: nowrap;
  }
  .nx-home-ew-live__kpi-label {
    font-size: 7px !important;
  }
  .nx-home-ew-live__kpi-norm {
    font-size: 7px !important;
  }
  .nx-home-ew-live__card {
    width: 100% !important;
    max-width: min(100%, 320px) !important;
    margin-top: 4px !important;
    padding: 16px 16px 12px !important;
    transform: none !important;
  }
  .nx-home-ew-live:hover .nx-home-ew-live__card,
  .nx-home-ew-live:focus-within .nx-home-ew-live__card {
    transform: none !important;
  }
  .nx-home-ew-live__cash {
    padding-top: 26px;
    font-size: 20px;
  }
  .nx-home-ew-live__iban {
    padding-top: 10px;
  }
}

/*
 * Tablet only: avatar/meta | bank card side-by-side — shorter widget.
 * Same specificity as admin equal-row rules so grid beats flex stack.
 */
@media (min-width: 768px) and (max-width: 991.98px) {
  #js-trigger-home-admin-wrapper .nx-home-admin-equal-row > [class*="col-"].nx-home-ew-live-col > .nx-home-ew-live,
  #js-trigger-home-team-wrapper .nx-home-admin-equal-row > [class*="col-"].nx-home-ew-live-col > .nx-home-ew-live,
  .nx-home-ew-live {
    display: grid !important;
    flex-direction: unset !important;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    grid-template-areas:
      "profile card"
      "kpis kpis";
    align-items: start !important;
    justify-items: stretch;
    column-gap: 14px;
    row-gap: 12px;
  }
  .nx-home-ew-live__profile {
    grid-area: profile;
    margin: 0;
    text-align: center;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .nx-home-ew-live__avatar {
    width: 64px !important;
    height: 64px !important;
  }
  .nx-home-ew-live__name {
    margin: 10px 0 4px;
    font-size: 14px;
  }
  .nx-home-ew-live__title {
    font-size: 12px;
  }
  .nx-home-ew-live__period {
    margin-top: 10px;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  #nx-home-ew-live .nx-home-ew-live__period .nx-home-select-wrap {
    width: fit-content !important;
    max-width: 100%;
  }
  #nx-home-ew-live .nx-home-ew-live__period .select2-container {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
  #nx-home-ew-live .nx-home-ew-live__period .select2-selection--single {
    width: auto !important;
    min-width: 0 !important;
  }
  #nx-home-ew-live .nx-home-ew-live__period .select2-selection__rendered {
    white-space: nowrap !important;
    padding-right: 1.75rem !important;
  }
  .nx-home-ew-live__cycle-dates {
    white-space: nowrap;
  }
  .nx-home-ew-live__kpis {
    grid-area: kpis;
    margin: 0 !important;
  }
  #js-trigger-home-admin-wrapper .nx-home-ew-live__card,
  #js-trigger-home-team-wrapper .nx-home-ew-live__card,
  .nx-home-ew-live__card {
    grid-area: card;
    width: 100% !important;
    max-width: min(100%, 300px) !important;
    margin: 0 auto !important;
    align-self: center;
    justify-self: center;
    padding: 14px 14px 12px !important;
  }
  .nx-home-ew-live__cash {
    font-size: 18px;
    padding-top: 24px;
  }
}

@media (max-width: 575.98px) {
  .nx-home-ew-live {
    padding: 14px 12px 12px !important;
  }
  .nx-home-ew-live__avatar {
    width: 64px !important;
    height: 64px !important;
  }
  .nx-home-ew-live__kpis {
    gap: 3px !important;
  }
  .nx-home-ew-live__kpi {
    padding: 6px 0 4px !important;
  }
  .nx-home-ew-live__card {
    max-width: 100% !important;
  }
  .nx-home-ew-live__cash {
    font-size: 18px;
    padding-top: 24px;
  }
  .nx-home-ew-live__iban {
    font-size: 12px;
  }
}
