/* Front-end host for the existing Afritech management workspace. */
.afps-staff-portal,
.afps-staff-portal * {
  box-sizing: border-box;
}

.afps-staff-portal {
  --afps-staff-nav: #0d1a33;
  --afps-staff-nav-muted: #9fb0ce;
  --afps-staff-accent: #f5b40a;
  --afps-staff-border: #dfe6f1;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  width: min(100vw - 32px, 1600px);
  min-height: 760px;
  margin: 24px 50%;
  transform: translateX(-50%);
  overflow: hidden;
  color: #0f172a;
  background: #f5f7fb;
  border: 1px solid var(--afps-staff-border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .13);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
}

/* The staff workspace is an application route, not a public content page. */
body.afi-staff-portal-page .afi-main > .afi-staff-workspace-page {
  padding: 0;
  background: #f5f7fb;
}
body.afi-staff-portal-page .afi-main > .afi-staff-workspace-page > .afi-container {
  width: 100%;
  max-width: none;
}
body.afi-staff-portal-page .afps-staff-portal {
  width: 100%;
  min-height: calc(100vh - var(--afi-header-h, 76px));
  margin: 0;
  transform: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.logged-in.afi-staff-portal-page .afps-staff-portal {
  min-height: calc(100vh - var(--afi-portal-top-offset, 0px));
  min-height: calc(100dvh - var(--afi-portal-top-offset, 0px));
}
body.logged-in.afi-staff-portal-page .afps-staff-sidebar {
  top: 0;
  height: calc(100vh - var(--afi-portal-top-offset, 0px));
  height: calc(100dvh - var(--afi-portal-top-offset, 0px));
}
body.logged-in.afi-staff-portal-page .afps-staff-toolbar {
  top: 0;
}

.afps-staff-skip {
  position: fixed;
  top: 8px;
  left: -9999px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #0b245d;
  font-weight: 700;
}
.afps-staff-skip:focus { left: 8px; }

.afps-staff-sidebar {
  position: sticky;
  top: var(--afi-header-h, 76px);
  display: flex;
  height: calc(100vh - var(--afi-header-h, 76px));
  min-height: 0;
  align-self: start;
  flex-direction: column;
  color: #fff;
  background:
    radial-gradient(circle at 10% 0, rgba(47, 82, 190, .28), transparent 32%),
    linear-gradient(180deg, #111f3c, var(--afps-staff-nav));
}
.afps-staff-menu-close {
  display: none;
}

.afps-staff-brand {
  display: flex;
  min-height: 78px;
  padding: 18px 20px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.09);
}
.afps-staff-brand > .dashicons { width: 28px; height: 28px; font-size: 28px; color: #8eb4ff; }
.afps-staff-brand-logo {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.16);
}
.afps-staff-brand strong,
.afps-staff-brand small { display: block; }
.afps-staff-brand strong { color: #fff; font-size: 15px; line-height: 1.25; }
.afps-staff-brand small { margin-top: 3px; color: var(--afps-staff-nav-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

.afps-staff-navigation {
  flex: 1;
  padding: 14px 10px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  /* Keep wheel/trackpad scrolling inside the navigation while it is hovered.
     Once it reaches either end, do not pass the remaining scroll to the page. */
  overscroll-behavior-y: contain;
}
.afps-staff-nav-group { margin-bottom: 16px; }
.afps-staff-nav-group > p {
  margin: 0 10px 6px;
  color: #7185aa;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.afps-staff-nav-group a {
  display: flex;
  min-height: 40px;
  padding: 9px 11px;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  color: #c7d2e7;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.afps-staff-nav-group a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
  text-decoration: none;
}
.afps-staff-nav-group a[aria-current="page"] {
  color: #fff;
  background: linear-gradient(90deg, rgba(43, 80, 190, .78), rgba(43, 80, 190, .34));
  box-shadow: inset 3px 0 0 var(--afps-staff-accent);
}
.afps-staff-nav-group a .dashicons { width: 18px; height: 18px; font-size: 18px; color: #8fa5ca; }
.afps-staff-nav-group a[aria-current="page"] .dashicons { color: #fff; }

.afps-staff-account {
  display: flex;
  margin: 12px 10px 0;
  padding: 12px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 10px;
  background: rgba(255,255,255,.055);
  color: #fff;
  cursor: default;
}
.afps-staff-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: #0b1f4e;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 800;
}
.afps-staff-account-copy {
  min-width: 0;
  flex: 1;
}
.afps-staff-account strong,
.afps-staff-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.afps-staff-account strong { color: #fff; font-size: 12px; }
.afps-staff-account small { margin-top: 2px; color: var(--afps-staff-nav-muted); font-size: 10px; }
.afps-staff-language { margin: 12px 18px 0; }
.afps-staff-language .afi-lang-switch {
  margin: 0;
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
}
.afps-staff-language .afi-lang-switch-item { color: rgba(255,255,255,.7); }
.afps-staff-language .afi-lang-switch-item:hover { color: #fff; }
.afps-staff-language .afi-lang-switch-item.is-active {
  background: var(--afps-staff-accent);
  color: #071a45;
}
.afps-staff-main { min-width: 0; background: #f7f9fc; }
.afps-staff-toolbar {
  position: sticky;
  top: var(--afi-header-h, 76px);
  z-index: 30;
  display: flex;
  min-height: 64px;
  padding: 0 24px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--afps-staff-border);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(12px);
}
.afps-staff-toolbar-title { font-weight: 750; color: #17233b; }
.afps-staff-toolbar-actions { display: flex; margin-left: auto; gap: 18px; }
.afps-staff-toolbar-actions a { color: #44536d; font-size: 13px; font-weight: 650; text-decoration: none; }
.afps-staff-toolbar-actions a:hover { color: #214ab3; }
.afps-staff-menu-toggle {
  display: none;
  padding: 7px 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--afps-staff-border);
  border-radius: 8px;
  color: #17233b;
  background: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.afps-staff-view { padding: 24px 24px 32px; overflow: hidden; }
.afps-staff-view > .wrap,
.afps-staff-view > .afps-module-bar + .wrap { max-width: none; }
.afps-staff-view .wrap { margin-right: 0; margin-left: 0; }
.afps-staff-view .afps-dashboard-shell,
.afps-staff-view .afps-dashboard-hero { max-width: none; }
.afps-staff-view .afps-module-bar { margin-top: 20px; }
.afps-staff-view .notice { margin-left: 0; }
.afps-staff-view .afps-account-wrap { padding-top: 24px; }
.afps-staff-view .afps-account-intro { color: #61708a; }
.afps-staff-view .afps-account-form {
  max-width: 980px;
  padding: 0;
  border: 0;
  background: transparent;
}
.afps-staff-view .form-table { width: 100%; border-collapse: collapse; }
.afps-staff-view .form-table th { width: 220px; padding: 18px 16px 18px 0; text-align: left; vertical-align: top; }
.afps-staff-view .form-table td { padding: 18px 0; }
.afps-account-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--afps-staff-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15,23,42,.04);
}
.afps-account-card-head {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-start;
  gap: 12px;
}
.afps-account-card-head > .dashicons {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #2449ae;
  background: #edf3ff;
  font-size: 19px;
}
.afps-account-card-head h2,
.afps-account-security-card > h2 {
  margin: 0;
  color: #15213a;
  font-size: 18px;
  line-height: 1.3;
}
.afps-account-card-head p {
  margin: 5px 0 0;
  color: #66758f;
  font-size: 13px;
}
.afps-account-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.afps-account-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  color: #293751;
  font-size: 13px;
  font-weight: 700;
}
.afps-account-field--wide { grid-column: 1 / -1; }
.afps-account-field input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cfd9e8;
  border-radius: 8px;
  color: #15213a;
  background: #fff;
  font: inherit;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
}
.afps-account-field input:focus {
  border-color: #3158c7;
  outline: 3px solid rgba(49,88,199,.14);
}
.afps-account-field input[readonly] {
  color: #738099;
  background: #f5f7fb;
  cursor: not-allowed;
}
.afps-account-field small {
  color: #77859d;
  font-size: 11px;
  font-weight: 500;
}
.afps-account-pending {
  display: flex;
  margin-top: 18px;
  padding: 12px 14px;
  align-items: center;
  gap: 10px;
  border: 1px solid #f2d27a;
  border-radius: 9px;
  color: #704d00;
  background: #fff8de;
  font-size: 12px;
}
.afps-account-pending > span:nth-child(2) { flex: 1; }
.afps-account-pending strong { display: block; margin-bottom: 2px; }
.afps-account-pending label { font-weight: 700; white-space: nowrap; }
.afps-account-security-card > h2 { margin-bottom: 14px; }
.afps-account-security-card .form-table { margin-top: 0; }
.afps-account-submit {
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  margin-top: 18px;
  padding: 12px;
  justify-content: flex-end;
  border: 1px solid var(--afps-staff-border);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(15,23,42,.12);
}

/* Staff pages keep only the support links people may need while working. */
.afi-footer.afi-footer-staff {
  padding: 20px 0;
  border-top: 1px solid rgba(255,255,255,.1);
}
.afi-footer-staff-inner {
  display: flex;
  align-items: center;
  gap: 24px;
}
.afi-footer-staff-brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.afi-footer-staff-brand strong { color: #fff; font-size: 13px; }
.afi-footer-staff-brand span { color: rgba(255,255,255,.55); font-size: 11px; }
.afi-footer-staff-links {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.afi-footer-staff-links a {
  color: rgba(255,255,255,.76);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}
.afi-footer-staff-links a:hover { color: #f5b40a; }
.afi-footer-staff-copy {
  margin: 0;
  color: rgba(255,255,255,.46);
  font-size: 11px;
  white-space: nowrap;
}

@media (max-width: 1050px) {
  .afps-staff-portal { grid-template-columns: 220px minmax(0, 1fr); }
  .afps-staff-view { padding-right: 16px; padding-left: 16px; }
  .afps-staff-toolbar { padding-right: 16px; padding-left: 16px; }
}

@media (max-width: 760px) {
  body.afps-staff-nav-visible { overflow: hidden; }
  .afps-staff-portal {
    display: block;
    width: 100%;
    min-height: calc(100dvh - var(--afi-portal-top-offset, 0px));
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  .afps-staff-portal::after {
    content: "";
    position: fixed;
    inset: var(--afi-portal-top-offset, 0px) 0 0;
    z-index: 50;
    background: rgba(7, 21, 56, .58);
    backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  .afps-staff-portal.afps-staff-nav-open::after {
    opacity: 1;
    pointer-events: auto;
  }
  .afps-staff-sidebar {
    position: fixed;
    inset: var(--afi-portal-top-offset, 0px) auto 0 0;
    z-index: 60;
    width: min(84vw, 300px);
    height: calc(100dvh - var(--afi-portal-top-offset, 0px));
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: 18px 0 50px rgba(0,0,0,.3);
  }
  .afps-staff-menu-close {
    position: absolute;
    top: 14px;
    right: 12px;
    display: inline-flex;
    width: 38px;
    height: 38px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 10px;
    color: #fff;
    background: rgba(255,255,255,.1);
    cursor: pointer;
  }
  .afps-staff-menu-close:hover,
  .afps-staff-menu-close:focus-visible {
    background: rgba(255,255,255,.2);
    outline: none;
  }
  .afps-staff-menu-close .dashicons { width: 20px; height: 20px; font-size: 20px; }
  .afps-staff-brand { padding-right: 62px; }
  .afps-staff-nav-open .afps-staff-sidebar { transform: translateX(0); }
  .afps-staff-menu-toggle { display: inline-flex; }
  .afps-staff-toolbar-title { display: none; }
  .afps-staff-toolbar-actions { gap: 10px; }
  .afps-staff-view { padding: 16px 10px 24px; }
  .afps-staff-view .form-table,
  .afps-staff-view .form-table tbody,
  .afps-staff-view .form-table tr,
  .afps-staff-view .form-table th,
  .afps-staff-view .form-table td { display: block; width: 100%; }
  .afps-staff-view .form-table th { padding-bottom: 4px; }
  .afps-staff-view .form-table td { padding-top: 4px; }
  .afps-account-fields { grid-template-columns: 1fr; }
  .afps-account-field--wide { grid-column: auto; }
  .afps-account-card { padding: 16px; }
  .afps-account-pending { align-items: flex-start; flex-wrap: wrap; }
  .afps-account-pending label { width: 100%; }
  .afps-account-submit { bottom: 8px; }
  .afi-footer-staff-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  .afi-footer-staff-links { margin-left: 0; gap: 12px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .afps-staff-sidebar { transition: none; }
}
