:root {
  --bg: #f4f9fb;
  --surface: #ffffff;
  --surface-soft: #eef9f7;
  --ink: #10233f;
  --muted: #607082;
  --line: #d8e2ea;
  --line-strong: #b5c4d0;
  --green: #0f9f75;
  --green-strong: #00376f;
  --green-soft: #ddf7ee;
  --red: #b42318;
  --red-soft: #fde3df;
  --teal: #00a98f;
  --teal-soft: #d9f7f2;
  --blue: #003f88;
  --blue-soft: #e4f0fc;
  --yellow: #8a6d00;
  --yellow-soft: #fff3bd;
  --focus: #006fbd;
  --shadow: 0 14px 32px rgba(0, 55, 111, 0.1);
}


* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--bg) 38%, #eef8f7 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.master-shell {
  min-height: 100vh;
}

.active-context-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 11px clamp(16px, 4vw, 40px);
  background: #123f38;
  color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.active-context-bar > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.active-context-bar span {
  color: #b9ddd3;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.active-context-bar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.86rem;
}

.context-change-button {
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-weight: 750;
}

.context-change-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.profile-membership-block,
.profile-membership-item,
.profile-membership-group {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-soft);
}

.profile-membership-block > span,
.profile-membership-group > strong {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-membership-block small,
.profile-membership-item small,
.profile-membership-group small {
  color: var(--muted);
}

.profile-membership-list {
  display: grid;
  gap: 9px;
}

.profile-membership-group > span {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.territorial-admin-link {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 13px 15px;
  border: 1px solid #a9d2c5;
  border-radius: 10px;
  background: #edf9f5;
  color: var(--ink);
  text-decoration: none;
}

.territorial-admin-link > span {
  display: grid;
  flex: 1;
}

.territorial-admin-link small {
  color: var(--muted);
}

@media (max-width: 760px) {
  .active-context-bar {
    grid-template-columns: 1fr 1fr;
  }

  .context-change-button {
    width: 100%;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px 28px;
  min-height: 126px;
  padding: 18px clamp(18px, 3vw, 36px);
  background: var(--surface);
  border-bottom: 4px solid var(--teal);
  box-shadow: 0 10px 26px rgba(0, 55, 111, 0.1);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 420px;
}

.app-logo {
  width: 104px;
  max-height: 104px;
  height: auto;
  object-fit: contain;
  flex: 0 0 auto;
  border-radius: 24px;
  box-shadow: 0 12px 30px rgba(0, 55, 111, 0.16);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 3px;
  color: var(--green-strong);
  font-size: 2.45rem;
  line-height: 1.15;
}

.brand-subtitle {
  margin: 0 0 2px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 850;
}

.creator-line {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 800;
}

.version-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  margin-top: 8px;
  padding: 3px 9px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--green-strong);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.module-icon svg,
.module-action svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.workspace {
  min-height: calc(100vh - 126px);
}

.main-area {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 44px) clamp(18px, 4vw, 44px);
}

.app-boot-view {
  display: grid;
  min-height: min(420px, calc(100vh - 220px));
  place-items: center;
}

.app-boot-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  width: min(100%, 720px);
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-boot-indicator {
  display: inline-flex;
  width: 42px;
  height: 42px;
  border: 4px solid var(--teal-soft);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: appBootSpin 900ms linear infinite;
}

.app-boot-view[data-state="error"] .app-boot-card {
  border-left-color: var(--red);
}

.app-boot-view[data-state="error"] .app-boot-indicator {
  border-color: var(--red-soft);
  border-top-color: var(--red);
}

.app-boot-card h2 {
  margin: 0 0 8px;
  color: var(--green-strong);
  font-size: 1.55rem;
  line-height: 1.1;
}

.app-boot-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.app-boot-details {
  margin-top: 10px !important;
  color: var(--red) !important;
  font-size: 0.9rem;
}

.app-boot-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 38px;
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--green-strong);
  font-weight: 900;
  text-decoration: none;
}

.app-boot-retry:hover {
  border-color: var(--teal);
  color: var(--blue);
}

@keyframes appBootSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-boot-indicator {
    animation: none;
  }
}

.login-view,
.module-selection-view {
  min-width: 0;
}

.welcome-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 0;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid var(--line);
  border-left: 8px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.welcome-hero::after {
  content: "";
  position: absolute;
  right: clamp(18px, 4vw, 54px);
  bottom: 14px;
  width: min(190px, 34vw);
  aspect-ratio: 1;
  background: url("assets/icon-512.png?v=20260711-fresh-aps") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.welcome-copy {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 14px;
  min-width: 0;
}

.welcome-copy h2 {
  max-width: 760px;
  margin: 0;
  color: var(--green-strong);
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.02;
}

.welcome-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 700;
}

.hero-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.hero-highlights span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--green-strong);
  font-size: 0.88rem;
  font-weight: 900;
}

.hero-highlights svg {
  width: 18px;
  height: 18px;
  color: var(--teal);
  stroke-width: 2.4;
}

.beta-login-panel {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--blue);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 55, 111, 0.11);
}

.beta-login-panel h3 {
  margin: 0;
  color: var(--green-strong);
  font-size: 1.24rem;
  line-height: 1.15;
}

.beta-login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.beta-login-panel input,
.beta-login-panel select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.legal-consent {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.legal-consent input {
  width: auto;
  min-height: auto;
  margin-top: 2px;
}

.legal-consent a,
.legal-links a,
.app-version-footer a {
  color: var(--green-strong);
  font-weight: 900;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.78rem;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-mode-switch button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-mode-switch button[aria-selected="true"] {
  border-color: var(--line-strong);
  background: #ffffff;
  color: var(--green-strong);
  box-shadow: 0 6px 14px rgba(0, 55, 111, 0.08);
}

.auth-mode-switch button:disabled {
  cursor: wait;
  opacity: 0.74;
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green-strong);
  color: #ffffff;
  font-weight: 900;
}

.auth-submit:hover {
  background: var(--blue);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-submit svg {
  width: 18px;
  height: 18px;
}

.link-action {
  justify-self: start;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 900;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-action:hover {
  color: var(--green-strong);
}

.link-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.auth-status {
  min-height: 20px;
  margin: 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.auth-status:not(:empty) {
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: var(--blue-soft);
  color: var(--blue);
}

.auth-status[data-tone="error"]:not(:empty) {
  border-color: #f2b8b3;
  background: var(--red-soft);
  color: var(--red);
}

.auth-status[data-tone="success"]:not(:empty) {
  border-color: #9bd8c1;
  background: var(--green-soft);
  color: #087451;
}

.beta-login-panel small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.home-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.module-selection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.module-selection-heading .home-heading {
  margin-bottom: 0;
}

.auth-user-panel {
  display: grid;
  gap: 2px;
  min-width: min(100%, 260px);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 55, 111, 0.08);
}

.auth-user-panel span {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-user-panel strong {
  color: var(--green-strong);
  font-size: 0.95rem;
}

.auth-user-panel small {
  color: var(--muted);
  font-weight: 800;
}

.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--green-strong);
  font-weight: 900;
}

.logout-button:hover {
  border-color: var(--teal);
  color: var(--blue);
}

.logout-button svg {
  width: 18px;
  height: 18px;
}

.no-modules-message {
  margin: 16px 0 0;
  padding: 14px 16px;
  border: 1px solid #f2d46d;
  border-radius: 8px;
  background: var(--yellow-soft);
  color: var(--yellow);
  font-weight: 900;
}

.module-status {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid #f2b8b3;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 900;
}

.qf-dashboard {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
}

.qf-dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qf-dashboard-header h3 {
  margin: 0;
  color: var(--green-strong);
  font-size: 1.35rem;
  line-height: 1.15;
}

.qf-dashboard-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--green-strong);
}

.qf-dashboard-refresh:hover {
  border-color: var(--teal);
  color: var(--blue);
}

.qf-dashboard-refresh svg {
  width: 18px;
  height: 18px;
}

.qf-dashboard-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qf-dashboard-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.qf-dashboard-summary strong {
  color: var(--green-strong);
}

.qf-dashboard-summary span[data-status="critical"] {
  border-color: #f2b8b3;
  background: var(--red-soft);
  color: var(--red);
}

.qf-dashboard-summary span[data-status="pending"] {
  border-color: #f2d46d;
  background: var(--yellow-soft);
  color: var(--yellow);
}

.qf-dashboard-summary span[data-status="review"] {
  border-color: var(--line-strong);
  background: var(--blue-soft);
  color: var(--blue);
}

.qf-dashboard-summary span[data-status="info"] {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--green-strong);
}

.qf-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.qf-dashboard-item {
  --dashboard-status: var(--teal);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: start;
  gap: 10px 12px;
  width: 100%;
  min-height: 108px;
  padding: 13px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--dashboard-status);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 22px rgba(0, 55, 111, 0.08);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.qf-dashboard-item:hover {
  transform: translateY(-1px);
  border-color: var(--dashboard-status);
  box-shadow: 0 13px 26px rgba(0, 55, 111, 0.12);
}

.qf-dashboard-item[data-status="critical"] {
  --dashboard-status: var(--red);
}

.qf-dashboard-item[data-status="pending"] {
  --dashboard-status: var(--yellow);
}

.qf-dashboard-item[data-status="review"] {
  --dashboard-status: var(--blue);
}

.qf-dashboard-item[data-status="info"] {
  --dashboard-status: var(--teal);
}

.qf-dashboard-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--dashboard-status);
}

.qf-dashboard-item-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 2.3;
}

.qf-dashboard-item-copy {
  min-width: 0;
}

.qf-dashboard-item-copy strong {
  display: block;
  margin-bottom: 5px;
  color: var(--green-strong);
  font-size: 0.98rem;
  line-height: 1.2;
}

.qf-dashboard-item-copy small {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.34;
}

.qf-dashboard-item-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.qf-dashboard-item-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--dashboard-status);
  font-size: 0.76rem;
  font-weight: 900;
}

.qf-dashboard-item-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dashboard-status);
  font-size: 0.84rem;
  font-weight: 900;
}

.qf-dashboard-item-action svg {
  width: 16px;
  height: 16px;
}

.qf-dashboard-empty,
.qf-dashboard-disclaimer {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.qf-dashboard-disclaimer {
  color: var(--green-strong);
}

.home-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.home-kicker .eyebrow {
  margin: 0;
}

.beta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid var(--teal);
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--green-strong);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.home-heading h2 {
  margin-bottom: 0;
  color: var(--green-strong);
  font-size: 2.05rem;
  line-height: 1.08;
}

.home-intro {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.module-card {
  --module-color: var(--green);
  --module-soft: var(--green-soft);
  display: grid;
  grid-template-rows: auto minmax(64px, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  min-height: 174px;
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--module-color);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfefe 100%);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.module-card.inventory {
  --module-color: var(--blue);
  --module-soft: var(--blue-soft);
  order: 7;
}

.module-card.clinical {
  --module-color: var(--red);
  --module-soft: var(--red-soft);
  order: 5;
}

.module-card.medical-clinical {
  --module-color: var(--blue);
  --module-soft: var(--blue-soft);
  order: 6;
}

.module-card.planning {
  --module-color: var(--teal);
  --module-soft: var(--teal-soft);
  order: 8;
}

.module-card.orders {
  --module-color: var(--yellow);
  --module-soft: var(--yellow-soft);
  order: 9;
}

.module-card.profile {
  --module-color: var(--green);
  --module-soft: var(--green-soft);
  order: 1;
}

.module-card.admin-users {
  --module-color: var(--blue);
  --module-soft: var(--blue-soft);
  order: 3;
}

.module-card.pharmacy-team {
  --module-color: var(--teal);
  --module-soft: var(--teal-soft);
  order: 2;
}

.module-card.data-admin {
  --module-color: var(--green);
  --module-soft: var(--green-soft);
  order: 4;
}

.module-card.technovigilance {
  --module-color: var(--red);
  --module-soft: var(--red-soft);
  order: 10;
}

.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--module-color);
  box-shadow: 0 16px 34px rgba(0, 55, 111, 0.16);
}

.module-card:active {
  transform: translateY(1px);
}

.module-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--module-soft), #ffffff);
  color: var(--module-color);
}

.module-icon svg {
  width: 22px;
  height: 22px;
}

.module-copy strong {
  display: block;
  margin-bottom: 6px;
  color: var(--green-strong);
  font-size: 1.02rem;
  line-height: 1.18;
}

.module-copy small {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.module-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--module-color);
  font-size: 0.92rem;
  font-weight: 900;
}

.mission-note {
  margin-top: 22px;
  padding: 18px 20px;
  border-left: 6px solid var(--teal);
  background: #fafdfe;
  border-radius: 0 8px 8px 0;
}

.mission-note p {
  max-width: 920px;
  margin: 0;
  color: var(--green-strong);
  font-size: 1rem;
  font-weight: 700;
}

.app-version-footer {
  width: min(100%, 1220px);
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 44px) 18px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-align: right;
}

.management-view {
  display: grid;
  gap: 18px;
}

.management-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-left: 8px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.management-header h2 {
  margin: 0 0 8px;
  color: var(--green-strong);
  font-size: 2rem;
  line-height: 1.08;
}

.management-header h3 {
  margin: 0 0 8px;
  color: var(--green-strong);
  font-size: 1.35rem;
  line-height: 1.12;
}

.management-header.compact {
  box-shadow: none;
}

.management-header p:last-child {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.management-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action,
.table-action,
.icon-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  border-radius: 8px;
  font-weight: 900;
}

.primary-action {
  padding: 8px 14px;
  border: 1px solid var(--green-strong);
  background: var(--green-strong);
  color: #ffffff;
}

.primary-action:hover {
  border-color: var(--blue);
  background: var(--blue);
}

.secondary-action,
.table-action {
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: #ffffff;
  color: var(--green-strong);
}

.secondary-action:hover,
.table-action:hover {
  border-color: var(--teal);
  color: var(--blue);
}

.primary-action:disabled,
.secondary-action:disabled,
.table-action:disabled {
  cursor: wait;
  opacity: 0.68;
}

.primary-action svg,
.secondary-action svg,
.table-action svg {
  width: 17px;
  height: 17px;
}

.action-status {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.action-status[data-tone="success"] {
  border-color: #9bd8c1;
  background: var(--green-soft);
  color: #087451;
}

.action-status[data-tone="error"] {
  border-color: #f2b8b3;
  background: var(--red-soft);
  color: var(--red);
}

.settings-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.settings-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--teal);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(0, 55, 111, 0.08);
}

.password-reset-panel {
  width: min(100%, 520px);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.panel-heading svg {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--teal);
  stroke-width: 2.3;
}

.panel-heading h3,
.app-dialog h3 {
  margin: 0 0 4px;
  color: var(--green-strong);
  font-size: 1.08rem;
  line-height: 1.16;
}

.panel-heading p,
.dialog-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.settings-panel label,
.admin-toolbar label,
.app-dialog label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
}

.settings-panel input,
.settings-panel select,
.admin-toolbar input,
.admin-toolbar select,
.app-dialog input,
.app-dialog select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

.settings-panel input:disabled,
.settings-panel select:disabled,
.app-dialog input:disabled {
  background: #eef3f6;
  color: var(--muted);
}

.profile-centers-panel {
  grid-column: span 3;
}

.profile-preferences-panel {
  min-height: 100%;
}

.profile-team-panel {
  grid-column: span 3;
}

.profile-team-note {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.profile-team-table-wrap {
  box-shadow: none;
}

.profile-team-table {
  min-width: 720px;
}

.profile-center-actions,
.profile-centers-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-center-chip,
.profile-center-empty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafdfe;
  color: var(--green-strong);
  font-weight: 900;
}

.profile-center-chip small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-center-empty {
  color: var(--muted);
}

.profile-switch {
  display: flex !important;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafdfe;
  cursor: pointer;
}

.profile-switch input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.profile-switch span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.profile-switch strong {
  color: var(--green-strong);
  font-size: 0.94rem;
  line-height: 1.2;
}

.profile-switch small,
.profile-preference-status {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

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

.readonly-grid p,
.detail-grid p {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafdfe;
}

.readonly-grid span,
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.readonly-grid strong,
.detail-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--green-strong);
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px) auto;
  align-items: end;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.result-count {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--green-strong);
  font-weight: 900;
  white-space: nowrap;
}

.admin-secondary-section {
  display: grid;
  gap: 14px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(0, 55, 111, 0.06);
}

.admin-users-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.admin-users-table th,
.admin-users-table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-users-table th {
  background: var(--surface-soft);
  color: var(--green-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-users-table td {
  color: var(--ink);
  font-size: 0.9rem;
}

.user-cell strong {
  display: block;
  color: var(--green-strong);
  overflow-wrap: anywhere;
}

.user-cell small,
.date-cell small,
.role-cell small {
  display: block;
  color: var(--muted);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.role-cell {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.status-pill,
.role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 900;
}

.role-pill {
  border: 1px solid var(--line);
  background: var(--blue-soft);
  color: var(--blue);
}

.status-pill.is-active {
  border: 1px solid #9bd8c1;
  background: var(--green-soft);
  color: #087451;
}

.status-pill.is-inactive {
  border: 1px solid #f2b8b3;
  background: var(--red-soft);
  color: var(--red);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 230px;
}

.table-action {
  min-height: 32px;
  padding: 6px 9px;
  font-size: 0.78rem;
}

.empty-state {
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.app-dialog {
  width: min(94vw, 620px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 55, 111, 0.22);
}

.app-dialog::backdrop {
  background: rgba(16, 35, 63, 0.38);
}

.dialog-body {
  display: grid;
  gap: 14px;
  padding: 22px;
}

.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--muted);
}

.icon-close svg {
  width: 17px;
  height: 17px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

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

.audit-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.audit-list li {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafdfe;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

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

  .settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .welcome-hero {
    grid-template-columns: 1fr;
  }

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

  .admin-toolbar {
    grid-template-columns: 1fr;
  }

  .module-card {
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 0;
    align-items: center;
  }

  .module-icon {
    grid-row: 1 / span 2;
  }

  .module-action {
    grid-column: 2;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px;
  }

  .brand-lockup {
    align-items: flex-start;
    flex: 0 1 auto;
    width: 100%;
  }

  h1 {
    font-size: 1.55rem;
  }

  .home-heading h2 {
    font-size: 1.55rem;
  }

  .home-intro,
  .mission-note p {
    font-size: 0.95rem;
  }

  .app-logo {
    width: 76px;
    max-height: 76px;
  }

  .brand-subtitle {
    font-size: 0.92rem;
  }

  .main-area {
    padding: 20px 16px 28px;
  }

  .welcome-hero {
    padding: 20px;
  }

  .app-boot-card {
    grid-template-columns: 1fr;
  }

  .welcome-copy h2 {
    font-size: 2rem;
  }

  .module-selection-heading,
  .auth-user-panel,
  .logout-button,
  .management-actions,
  .management-actions .secondary-action,
  .management-actions .logout-button {
    width: 100%;
  }

  .management-header {
    padding: 18px;
  }

  .management-header h2 {
    font-size: 1.55rem;
  }

  .readonly-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .profile-centers-panel {
    grid-column: auto;
  }

  .module-card {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 16px;
  }

  .module-icon {
    width: 48px;
    height: 48px;
  }

  .module-copy strong {
    font-size: 1.08rem;
  }

}
/* SIFAPS 1.1 — identidad visual renovada */
:root {
  --bg: #eef5f7;
  --surface-soft: #e8f5f3;
  --ink: #10263d;
  --muted: #607286;
  --line: #d4e1e6;
  --green-strong: #073b5c;
  --teal: #0cb39a;
  --blue: #075aa5;
  --shadow: 0 18px 46px rgba(7, 59, 92, 0.13);
}

body {
  background:
    radial-gradient(circle at 8% 10%, rgba(12, 179, 154, 0.13), transparent 28rem),
    radial-gradient(circle at 92% 24%, rgba(7, 90, 165, 0.1), transparent 30rem),
    linear-gradient(180deg, #f8fbfc 0%, var(--bg) 52%, #e8f3f2 100%);
}

.topbar {
  position: relative;
  min-height: 138px;
  border-bottom: 0;
  background: linear-gradient(125deg, #062b49 0%, #074d68 55%, #087a79 100%);
  box-shadow: 0 16px 40px rgba(5, 42, 70, 0.24);
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  top: -100px;
  right: 5vw;
  width: 320px;
  height: 320px;
  border: 54px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}

.topbar .brand-lockup {
  position: relative;
  z-index: 1;
}

.topbar .app-logo {
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(0, 22, 38, 0.28);
}

.topbar h1,
.topbar .brand-subtitle {
  color: #ffffff;
}

.topbar .eyebrow {
  color: #79ead7;
}

.topbar .creator-line {
  color: rgba(255, 255, 255, 0.75);
}

.topbar .version-pill {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(10px);
}

.main-area {
  width: min(100%, 1280px);
}

.welcome-hero {
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, 0.72fr);
  gap: clamp(24px, 4vw, 54px);
  padding: clamp(28px, 5vw, 58px);
  border: 0;
  border-radius: 28px;
  background: linear-gradient(135deg, #073b5c 0%, #075d70 58%, #0a8d80 100%);
  box-shadow: 0 28px 70px rgba(7, 59, 92, 0.22);
}

.welcome-hero::after {
  right: 35%;
  bottom: -28px;
  width: min(320px, 45vw);
  opacity: 0.08;
  filter: brightness(0) invert(1);
}

.welcome-copy h2,
.welcome-copy p {
  color: #ffffff;
}

.welcome-copy p {
  color: rgba(255, 255, 255, 0.84);
}

.release-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  backdrop-filter: blur(12px);
}

.release-banner > span:last-child {
  display: grid;
  gap: 1px;
}

.release-banner strong,
.release-banner small {
  display: block;
}

.release-banner small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.78rem;
  font-weight: 700;
}

.release-mark {
  display: inline-grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  background: #ffffff;
  color: #075d70;
  font-size: 1rem;
  font-weight: 950;
  box-shadow: 0 10px 22px rgba(0, 31, 49, 0.2);
}

.hero-highlights span {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  backdrop-filter: blur(8px);
}

.hero-highlights svg {
  color: #79ead7;
}

.beta-login-panel {
  padding: clamp(20px, 3vw, 28px);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 24px 58px rgba(0, 28, 47, 0.24);
}

.beta-login-panel h3 {
  font-size: 1.45rem;
}

.beta-login-panel input,
.beta-login-panel select {
  min-height: 46px;
  border-radius: 12px;
  background: #fbfdfe;
}

.auth-mode-switch {
  border-radius: 13px;
}

.auth-mode-switch button,
.link-action,
.logout-button,
.qf-dashboard-refresh {
  min-height: 44px;
}

.auth-mode-switch button {
  border-radius: 9px;
}

.auth-submit {
  min-height: 48px;
  border-radius: 12px;
  background: linear-gradient(110deg, #073b5c, #087f7b);
  box-shadow: 0 12px 24px rgba(7, 59, 92, 0.2);
}

.module-selection-heading {
  align-items: center;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 22px;
  background: linear-gradient(120deg, #073b5c 0%, #075b70 68%, #087f7b 100%);
  box-shadow: 0 20px 48px rgba(7, 59, 92, 0.18);
}

.module-selection-heading .home-heading {
  flex: 1 1 460px;
}

.module-selection-heading .eyebrow,
.module-selection-heading .home-heading h2,
.module-selection-heading .home-intro {
  color: #ffffff;
}

.module-selection-heading .home-intro {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
}

.module-selection-heading .beta-badge {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.13);
  color: #ffffff;
}

.module-selection-heading .auth-user-panel {
  border-color: rgba(255, 255, 255, 0.22);
  border-left-color: #79ead7;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.module-selection-heading .auth-user-panel span,
.module-selection-heading .auth-user-panel strong,
.module-selection-heading .auth-user-panel small {
  color: #ffffff;
}

.module-selection-heading .logout-button {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.qf-dashboard {
  padding: 20px;
  border: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.module-grid {
  gap: 16px;
}

.module-card {
  position: relative;
  min-height: 188px;
  padding: 18px;
  border: 1px solid rgba(206, 221, 227, 0.9);
  border-top: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbfc 100%);
  box-shadow: 0 14px 36px rgba(7, 59, 92, 0.11);
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--module-color), color-mix(in srgb, var(--module-color), white 45%));
}

.module-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 46px rgba(7, 59, 92, 0.18);
}

.module-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.module-copy strong {
  font-size: 1.08rem;
}

.module-action {
  min-height: 28px;
}

.app-version-footer {
  padding-top: 8px;
}

@media (max-width: 980px) {
  .welcome-hero {
    grid-template-columns: 1fr;
  }

  .module-selection-heading {
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .topbar {
    min-height: 0;
    padding: 18px;
  }

  .welcome-hero {
    padding: 20px;
    border-radius: 22px;
  }

  .release-banner {
    align-items: flex-start;
    width: 100%;
  }

  .release-mark {
    flex: 0 0 auto;
  }

  .module-selection-heading {
    flex-direction: column;
    align-items: stretch;
    border-radius: 18px;
  }

  .module-selection-heading .home-heading {
    flex: 0 1 auto;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .module-selection-heading .auth-user-panel {
    width: 100%;
    min-width: 0;
  }

  .module-selection-heading .auth-user-panel strong,
  .module-selection-heading .auth-user-panel small {
    overflow-wrap: anywhere;
  }

  .module-selection-heading .logout-button {
    align-self: stretch;
  }

  .module-card {
    min-height: 0;
    border-radius: 16px;
  }
}
