/* People & access — sign-in screens, rail user box, settings sections (public/modules/security.js). Rules: docs/BRAND.md */

/* ── Full-screen sign-in / first run / forced password change ── */
body.sf-locked > .sidebar, body.sf-locked > .shell { visibility: hidden; }
.sf-login {
  position: fixed; inset: 0; z-index: 1000; overflow-y: auto; background: var(--graphite); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px;
}
/* one strip of gaffer tape along the bottom edge, like the logo */
.sf-login::after { content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 10px; background: var(--gaffer); }
.sf-login-stage { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: stretch; margin: auto 0; }
.sf-login-mark { display: flex; align-items: center; gap: 12px; margin: 0 0 28px 2px; }
.sf-login-mark .sf-mark { box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); border-radius: 8px; }
.sf-login-word { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -.005em; }
.sf-login-card { position: relative; background: var(--paper); color: var(--graphite); border-radius: var(--r-panel); padding: 32px 28px 24px; }
/* a torn piece of gaffer tape holding the card */
.sf-login-tape { position: absolute; top: -11px; left: 50%; width: 112px; height: 22px; margin-left: -56px; background: var(--gaffer); transform: rotate(-2.5deg);
  clip-path: polygon(2% 0, 98% 6%, 100% 30%, 97% 52%, 100% 80%, 98% 100%, 1% 94%, 0 70%, 3% 46%, 0 22%); opacity: .96; }
.sf-login-co { font-size: 13px; color: var(--steel); margin-bottom: 6px; }
.sf-login-title { font-family: var(--font-display); font-size: 26px; margin: 0 0 6px; }
.sf-login-sub { margin: 0 0 20px; color: var(--steel); }
.sf-login-note { margin: 0 0 18px; padding: 9px 12px; border-radius: var(--r-ctl); background: var(--info-wash); color: #22548A; font-size: 13px; }
.sf-login-form { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.sf-login-sub + .sf-login-form, .sf-login-note + .sf-login-form { margin-top: 0; }
.sf-login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--graphite); min-width: 0; }
.sf-login-form label em { font-style: normal; font-weight: 400; color: var(--steel); }
.sf-login-form input { font-size: 15px; height: 44px; padding: 0 12px; }
.sf-login-form input:focus { outline: 2px solid var(--gaffer); outline-offset: 0; border-color: var(--graphite); }
.sf-login-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sf-login-hint { color: var(--steel); font-size: 12px; margin-top: -6px; }
.sf-login-err { background: var(--bad-wash); color: #962A23; border-left: 3px solid var(--bad); border-radius: var(--r-ctl); padding: 9px 12px; font-size: 13px; }
.sf-login-btn { justify-content: center; height: 44px; font-size: 15px; margin-top: 4px; }
.sf-login-help { margin: 18px 0 0; font-size: 13px; color: var(--steel); }
.sf-login-foot { margin: 22px 2px 0; font-size: 13px; color: #AEB7C1; }
@media (max-width: 480px) { .sf-login-card { padding: 28px 18px 20px; } .sf-login-2 { grid-template-columns: 1fr; } }

/* ── Rail footer user box ── */
#sf-userbox { position: relative; padding: 8px 10px; }
.sf-user { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; background: none; border: 0; border-radius: var(--r-ctl); padding: 6px 8px;
  color: var(--graphite); font: inherit; cursor: pointer; text-align: left; }
.sf-user:hover, .sf-user[aria-expanded="true"] { background: var(--concrete); }
.sf-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; position: relative; overflow: hidden;
  background: var(--graphite); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 12px; }
.sf-user-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.sf-user-txt strong { color: var(--graphite); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-user-txt small { color: var(--steel); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sf-user-caret { color: var(--steel); display: grid; place-items: center; font-size: 0; }
.sf-user-caret:not([data-tidy]) { font-size: 11px; }
.sf-user-menu { position: absolute; left: 10px; right: 10px; bottom: calc(100% - 2px); background: var(--paper); color: var(--graphite); border: 1px solid var(--rule);
  border-radius: var(--r-panel); box-shadow: var(--float); padding: 6px; z-index: 50; }
.sf-user-menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule-soft); margin-bottom: 4px; display: flex; flex-direction: column; }
.sf-user-menu-head small { color: var(--steel); font-size: 12px; }
.sf-user-menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; text-align: left; background: none; border: 0; padding: 6px 10px;
  border-radius: var(--r-ctl); font: inherit; cursor: pointer; color: var(--graphite); }
.sf-user-menu button svg { color: var(--steel); flex-shrink: 0; }
.sf-user-menu button:hover { background: var(--concrete); }

/* ── Settings sections ── */
.sec-lede { margin: 0 0 14px; color: var(--steel); }
.sec-toolbar { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sec-toolbar input[type=search] { min-width: 260px; height: 36px; }
.sec-filters { align-items: flex-end; }
.sec-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; color: var(--steel); }
.sec-filters label.grow { flex: 1; min-width: 200px; }
.sec-filters select, .sec-filters input { height: 36px; min-width: 0; }
.sec-filters input[type=search] { min-width: 150px; width: 100%; }
.sec-user { display: flex; align-items: center; gap: 10px; }
.sec-user .sf-avatar { width: 30px; height: 30px; font-size: 11px; }
.sec-user small { display: block; color: var(--steel); }
.sec-role { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
  background: var(--paper); color: var(--graphite); border: 1px solid var(--rule); }
.sec-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.sec-inactive td { color: var(--steel); }
.sec-inactive .sf-avatar { background: var(--steel); }
.sec-temp { font-family: var(--font-mono); font-size: 20px; background: var(--graphite); color: var(--gaffer);
  padding: 14px 16px; border-radius: var(--r-panel); text-align: center; user-select: all; margin: 10px 0; }

/* roles */
.sec-groups { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .sec-groups { grid-template-columns: 1fr; } }
.sec-rolelist .card-head { padding-bottom: 8px; }
.sec-glist { display: flex; flex-direction: column; gap: 2px; padding: 0 8px 8px; }
.sec-glist button { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; background: none; border: 0; position: relative;
  border-radius: var(--r-ctl); padding: 8px 10px; min-height: 38px; font: inherit; color: var(--graphite); cursor: pointer; }
.sec-glist button:hover { background: var(--concrete); }
.sec-glist button.active { background: var(--teal-wash); color: var(--teal-dark); font-weight: 600; }
.sec-glist button.active::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--teal); }
.sec-glist small { color: var(--steel); font-weight: 400; font-size: 12px; white-space: nowrap; }
@media (max-width: 1100px) { .sec-glist { flex-direction: row; flex-wrap: wrap; } .sec-glist button.active::before { display: none; } }
.sec-role-head { align-items: flex-start; }
.sec-role-head h3 { font-size: 20px; display: flex; gap: 8px; align-items: center; }
.sec-role-head p { margin: 4px 0 0; }
.sec-role-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sec-all { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-panel); margin: 4px 0 16px; cursor: pointer; }
.sec-all.on { background: var(--gaffer-wash); border-color: #EBD78A; }
.sec-all span, .sec-perm span { display: flex; flex-direction: column; gap: 1px; }
.sec-all small, .sec-perm small { color: var(--steel); font-size: 13px; font-weight: 400; }
.sec-all input, .sec-perm input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--teal); flex-shrink: 0; cursor: pointer; }
.sec-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 24px; }
.sec-matrix[aria-disabled="true"] .sec-perm { opacity: .6; }
.sec-area { padding-bottom: 8px; }
.sec-area-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--rule); padding: 8px 2px 6px; margin-bottom: 2px; }
.sec-area-head h4 { margin: 0; font-size: 14px; font-family: var(--font-display); }
.sec-area-head .linkish { font-size: 13px; text-decoration: none; font-weight: 600; }
.sec-area-head .linkish:disabled { color: var(--steel); cursor: default; }
.sec-perm { display: flex; gap: 12px; align-items: flex-start; padding: 8px 2px; border-bottom: 1px solid var(--rule-soft); cursor: pointer; font-weight: 400; }
.sec-perm:last-child { border-bottom: 0; }
.sec-perm strong { font-weight: 600; }
.sec-savebar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--rule);
  background: var(--paper); border-radius: 0 0 var(--r-panel) var(--r-panel); }
.sec-savebar .muted { margin-right: auto; }
.sec-savebar.is-dirty { box-shadow: inset 0 3px 0 var(--gaffer); }
.sec-savebar.is-dirty .muted { color: var(--graphite); font-weight: 600; }

/* password rules */
.sec-policy h4 { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--rule-soft); font-size: 14px; font-family: var(--font-display); grid-column: 1 / -1; }
.sec-policy h4:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sec-state { display: flex; gap: 12px; align-items: flex-start; }
.sec-state p { margin: 2px 0 0; }
.sec-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--ok); }
.sec-state.off .sec-dot { background: var(--bad); }
.sec-detail { max-width: 420px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--graphite); font-size: 13px; }
.sec-more { position: relative; display: inline-block; }
.sec-more > summary { list-style: none; }
.sec-more > summary::-webkit-details-marker { display: none; }
.sec-more[open] > summary { border-color: var(--steel); background: var(--concrete); }
.sec-more-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 180px; background: var(--paper); border: 1px solid var(--rule);
  border-radius: var(--r-panel); box-shadow: var(--float); padding: 6px; text-align: left; }
.sec-more-menu button { display: block; width: 100%; min-height: 36px; text-align: left; background: none; border: 0; padding: 6px 10px; border-radius: var(--r-ctl); font: inherit; color: var(--graphite); cursor: pointer; white-space: nowrap; }
.sec-more-menu button:hover { background: var(--concrete); }
.sec-more-menu button.is-danger { color: var(--bad); }
.sec-more-menu button.is-danger:hover { background: var(--bad-wash); }
