/* BIMAS UI polish — skip link, PWA update banner, mobile approvals */

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100050;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  background: var(--brand-blue);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transition: top 0.18s ease;
}

.skip-link:focus {
  top: 0.65rem;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.app-update-banner {
  position: fixed;
  left: 0.75rem;
  right: 0.75rem;
  bottom: calc(4.85rem + env(safe-area-inset-bottom, 0px));
  z-index: 10030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #0b3d8c, #1a5fc7);
  color: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.28);
  animation: appUpdateIn 0.28s ease both;
}

@media (min-width: 1025px) {
  .app-update-banner {
    left: auto;
    right: 1rem;
    bottom: 1rem;
    max-width: 24rem;
  }
}

.app-update-banner__copy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
}

.app-update-banner__copy .material-symbols-outlined {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.app-update-banner__actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}

.app-update-banner .btn {
  min-height: 2.25rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}

.app-update-banner .btn-primary {
  background: #fff;
  color: #0b3d8c;
  box-shadow: none;
}

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

.nav-item[aria-current="page"],
.bottomnav-item[aria-current="page"] {
  font-weight: 700;
}

/* Mobile approvals hub */
@media (max-width: 1024px) {
  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-hero {
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem;
  }

  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-title {
    font-size: 1.35rem;
  }

  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-subtitle {
    display: none;
  }

  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }

  .ops-hub-shell.ops-hub-shell--mobile .ops-hub-actions .btn {
    justify-content: center;
    width: 100%;
  }

  .ops-hub-mobile-approvals {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .notifications-module .notifications-header-actions .btn:nth-child(2),
  .notifications-module .notifications-header-actions .btn:nth-child(3) {
    display: none;
  }

  .notifications-page-header p {
    display: none;
  }
}

/* Mandatory first-login credential setup — global (not lazy-loaded) */
html[data-password-change-required="true"] {
  overflow: hidden;
}

html[data-password-change-required="true"] #app-topbar,
html[data-password-change-required="true"] #app-sidebar,
html[data-password-change-required="true"] #app-bottomnav,
html[data-password-change-required="true"] #app-content,
html[data-password-change-required="true"] #app-sidebar-backdrop,
html[data-password-change-required="true"] .app-update-banner {
  visibility: hidden !important;
  pointer-events: none !important;
}

.password-change-gate {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at 78% 12%, rgba(14, 165, 233, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(2, 12, 27, 0.98), rgba(4, 35, 68, 0.98));
  overflow: auto;
}

.password-change-gate::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: 0.2;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 32px 32px;
}

.password-change-card {
  position: relative;
  width: min(100%, 34rem);
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 35px 90px rgba(0, 0, 0, 0.42);
  padding: 1.45rem;
  animation: passwordGateIn 0.28s ease-out;
}

@keyframes passwordGateIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.password-change-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #075985;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.password-change-shield {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #075985, #0891b2);
  color: #fff;
  box-shadow: 0 8px 18px rgba(8, 145, 178, 0.25);
}

.password-change-shield .material-symbols-outlined {
  font-size: 1.2rem;
  color: #fff !important;
}

.password-change-heading { margin: 1rem 0; }

.password-change-kicker {
  color: #0284c7;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.password-change-heading h1 {
  margin: 0.25rem 0 0.35rem !important;
  color: #071a33 !important;
  font-size: 1.65rem !important;
  line-height: 1.15 !important;
  letter-spacing: -0.03em !important;
}

.password-change-heading p {
  margin: 0;
  color: #52637a;
  font-size: 0.78rem;
  line-height: 1.55;
}

.password-change-user {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem;
  border: 1px solid #dbe7f3;
  border-radius: 13px;
  background: #f8fbff;
}

.password-change-user > span {
  width: 2.35rem;
  height: 2.35rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #155eef;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 950;
}

.password-change-user > div { min-width: 0; flex: 1; }

.password-change-user strong,
.password-change-user small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.password-change-user strong { color: #0f172a; font-size: 0.78rem; }
.password-change-user small { color: #64748b; font-size: 0.64rem; margin-top: 0.12rem; }

.password-change-user em {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  color: #047857;
  font-size: 0.61rem;
  font-style: normal;
  font-weight: 900;
}

.password-change-user em .material-symbols-outlined { font-size: 0.9rem; }

.password-change-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.password-change-form label > span {
  display: block;
  margin-bottom: 0.3rem;
  color: #334155;
  font-size: 0.66rem;
  font-weight: 900;
}

.password-change-input {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid #d5e1ee;
  border-radius: 11px;
  background: #fff;
  padding: 0.5rem 0.6rem;
  transition: 0.15s;
}

.password-change-input:focus-within {
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.14);
}

.password-change-input > .material-symbols-outlined {
  font-size: 1rem;
  color: #0e7490;
}

.password-change-input input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font-size: 0.78rem;
}

.password-change-input button {
  border: 0;
  background: transparent;
  padding: 0.1rem;
  cursor: pointer;
}

.password-change-input button .material-symbols-outlined {
  font-size: 1rem;
  color: #64748b;
}

.password-strength > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  color: #64748b;
  font-size: 0.62rem;
  font-weight: 850;
}

.password-strength strong.ok { color: #047857; }
.password-strength strong.bad { color: #dc2626; }

.password-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.password-strength-bars i {
  height: 0.28rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.password-strength-bars i.active[data-level="1"] { background: #ef4444; }
.password-strength-bars i.active[data-level="2"] { background: #f59e0b; }
.password-strength-bars i.active[data-level="3"] { background: #0ea5e9; }
.password-strength-bars i.active[data-level="4"] { background: #10b981; }

.password-rule-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.password-rule-grid > span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.61rem;
  font-weight: 750;
}

.password-rule-grid .material-symbols-outlined {
  font-size: 0.9rem;
  color: #94a3b8;
}

.password-rule-grid > span.ok { color: #047857; }
.password-rule-grid > span.ok .material-symbols-outlined { color: #10b981; }

.password-change-error {
  padding: 0.55rem 0.65rem;
  border: 1px solid #fecaca;
  border-radius: 9px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.68rem;
  font-weight: 800;
}

.password-change-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  border: 0;
  border-radius: 11px;
  padding: 0.72rem;
  background: linear-gradient(135deg, #075985, #0e7490);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 950;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(14, 116, 144, 0.24);
}

.password-change-submit:disabled {
  opacity: 0.65;
  cursor: wait;
}

.password-change-submit .material-symbols-outlined {
  font-size: 1rem;
  color: #fff !important;
}

.password-change-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.password-change-foot > span {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.62rem;
}

.password-change-foot .material-symbols-outlined { font-size: 0.9rem; }

.password-change-foot button {
  border: 0;
  background: transparent;
  color: #155eef;
  font-size: 0.64rem;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 540px) {
  .password-change-card {
    padding: 1rem;
    border-radius: 16px;
  }

  .password-change-heading h1 {
    font-size: 1.35rem !important;
  }

  .password-rule-grid {
    grid-template-columns: 1fr;
  }

  .password-change-user em {
    display: none;
  }
}
