:root{--navy:#102542;--gold:#867655;--muted:#657687;--line:#dfe7ee}
body.access-page{background:#f6f8fb;color:var(--navy);min-height:100vh}
.access-container{width:min(720px,calc(100% - 36px));margin:54px auto 75px}.access-container.wide{width:min(1140px,calc(100% - 36px))}
.access-hero{margin:0 0 29px}.access-hero>span,.settings-heading span{font-size:11px;font-weight:800;color:var(--gold);letter-spacing:1.6px}.access-hero h1{font-size:clamp(30px,4.3vw,46px);line-height:1.15;letter-spacing:-1.3px;margin:13px 0}.access-hero p{font-size:16px;line-height:1.7;color:var(--muted);max-width:690px}
.access-card,.settings-section{border:1px solid #e4eaf0;border-radius:16px;background:#fff;box-shadow:0 8px 28px rgba(16,37,66,.04);padding:32px}
.access-message{padding:13px 17px;border:1px solid #dbe4ed;border-radius:10px;background:#f5f8fc;color:#31536b;font-size:14px;margin-bottom:20px;line-height:1.6;overflow-wrap:anywhere}
.access-message.error{color:#a32933;background:#fff6f6;border-color:#f0cbd0}
.access-form{display:grid;gap:13px}.access-form[hidden],.settings-section[hidden],#access-active[hidden]{display:none!important}
.access-form h2{font-size:24px;margin:4px 0 2px}.access-form h3{font-size:20px;margin:3px 0}
.access-form p,.access-small,.access-footnote{font-size:13px;color:var(--muted);line-height:1.7;margin:0 0 10px}
.access-form label{font-size:13px;font-weight:700;display:grid;gap:8px}.access-form input,.access-form select,.access-form textarea,.review-form input,.review-form select,.review-form textarea{width:100%;padding:12px 13px;border:1px solid #cfd9e3;border-radius:9px;background:#fff;color:var(--navy);font-size:14px;min-height:44px;box-sizing:border-box;outline-offset:2px}
.access-form textarea,.review-form textarea{min-height:82px;resize:vertical}
.access-form button,.access-primary,.settings-heading button,.review-form button{border:0;padding:13px 19px;border-radius:9px;background:var(--navy);color:#fff;font-weight:700;cursor:pointer;min-height:45px;font-size:14px;text-decoration:none;display:inline-flex;justify-content:center;align-items:center}
.access-form button:hover,.settings-heading button:hover,.review-form button:hover{background:#285071}.access-form button:disabled,.settings-heading button:disabled,.review-form button:disabled{opacity:.6;cursor:wait}
.access-actions{display:flex;flex-wrap:wrap;gap:9px;margin:15px 0}.access-secondary{border:1px solid #cbd7e1!important;background:#fff!important;color:#102542!important;padding:12px 15px;border-radius:9px;text-decoration:none;display:inline-flex;align-items:center;cursor:pointer}
.access-footnote{margin-top:21px}.settings-section{margin-top:20px}.settings-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;margin-bottom:16px;flex-wrap:wrap}.settings-heading h2{font-size:25px;margin:9px 0 2px}.settings-heading h3{font-size:19px;margin:0}
.norm-list{display:grid;gap:14px}.norm-card{border:1px solid var(--line);border-radius:12px;padding:19px;display:grid;gap:10px}.norm-card h3{font-size:18px;margin:0}.norm-card p{color:var(--muted);font-size:13px;line-height:1.65;overflow-wrap:anywhere;margin:0}.norm-card .state{display:inline-flex;border:1px solid #d7e0ea;border-radius:50px;padding:5px 11px;font-size:12px;font-weight:700;background:#f1f6fa;width:max-content;color:#345776}.norm-card .state.changed,.norm-card .state.overdue,.norm-card .state.needs_review,.norm-card .state.needs_version_bump{color:#ac352f;background:#fff1ec;border-color:#f0d0c4}
.norm-summary{display:flex;flex-wrap:wrap;gap:10px;margin:20px 0}.norm-summary span{padding:12px;background:#f4f7fb;border-radius:8px;font-size:13px}.review-form{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:8px}.review-form label{display:grid;gap:7px;font-weight:700;font-size:12px}.review-form .full{grid-column:1/-1}.review-form button{width:max-content}
.access-table-wrap{overflow-x:auto}.access-table{width:100%;border-collapse:collapse;font-size:13px;min-width:620px}.access-table th{color:#567083;background:#f4f7fb;font-weight:700;text-align:left}.access-table th,.access-table td{padding:12px;border-bottom:1px solid #e8edf2;vertical-align:middle}.access-table button{border:1px solid #cfdae4;background:#fff;border-radius:8px;padding:7px 9px;cursor:pointer;color:#254962}.settings-userform{background:#f7f9fc;border-radius:12px;padding:23px;margin-top:22px;border:1px solid #dfe7ee}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}
@media(max-width:700px){.access-container{margin:30px auto 50px}.access-card,.settings-section{padding:19px}.review-form,.settings-grid{grid-template-columns:1fr}.review-form .full{grid-column:1}.access-hero p{font-size:14px}.access-table{min-width:540px}}

.reset-password{display:flex;flex-wrap:wrap;align-items:flex-end;gap:7px;margin-top:10px}.reset-password label{font-size:10px;color:#5f7182;font-weight:700;display:grid;gap:5px}.reset-password input{border:1px solid #cfd9e3;border-radius:7px;padding:8px 9px;min-width:165px;max-width:190px;font-size:12px}.reset-password button{white-space:nowrap}
/* Workspace registry: readable stacked records on narrow displays. */
@media (max-width: 650px) {
  #workspaces-list .access-table,
  #workspaces-list .access-table tbody,
  #workspaces-list .access-table tr,
  #workspaces-list .access-table td { display: block; width: 100%; box-sizing: border-box; }
  #workspaces-list .access-table thead { display: none; }
  #workspaces-list .access-table tr { border: 1px solid #e4eaf0; border-radius: 12px; margin: 0 0 12px; padding: 8px 12px; background: #f8fafc; }
  #workspaces-list .access-table td { display: grid; grid-template-columns: 78px minmax(0,1fr); gap: 8px; padding: 8px 0; border: 0; overflow-wrap: anywhere; }
  #workspaces-list .access-table td + td { border-top: 1px solid #e8edf1; }
  #workspaces-list .access-table td::before { color: #718494; font-size: 12px; font-weight: 700; }
  #workspaces-list .access-table td:nth-child(1)::before { content: 'ID'; }
  #workspaces-list .access-table td:nth-child(2)::before { content: 'Код'; }
  #workspaces-list .access-table td:nth-child(3)::before { content: 'Заказчик'; }
  #workspaces-list .access-table td:nth-child(4)::before { content: 'Статус'; }
}

/* Optional TOTP enrollment: never hide the recovery values behind a scrolling row. */
.access-mfa{margin-top:24px;border-top:1px solid #dde6ec;padding-top:21px}
.access-mfa[hidden],#access-mfa-start[hidden],#access-mfa-setup[hidden],#access-mfa-recovery[hidden]{display:none!important}
.access-mfa h2{font-size:21px;margin:0 0 10px;color:#102542}
.mfa-secret{display:block;white-space:pre-wrap;overflow-wrap:anywhere;background:#eff4f8;border:1px solid #d5e1ea;color:#102542;border-radius:10px;padding:14px 16px;line-height:1.8;font-size:15px;letter-spacing:1px;margin:12px 0 15px}
#access-mfa-confirm{margin-bottom:16px}

/* Mobile security events as readable cards, not clipped desktop columns. */
@media (max-width: 650px) {
  #security-events .access-table, #security-events .access-table tbody,
  #security-events .access-table tr, #security-events .access-table td {display:block;width:100%;box-sizing:border-box}
  #security-events .access-table thead{display:none}
  #security-events .access-table tr{border:1px solid #dfe7ee;border-radius:11px;margin:0 0 12px;padding:7px 12px;background:#f8fafc}
  #security-events .access-table td{display:grid;grid-template-columns:90px minmax(0,1fr);gap:9px;padding:9px 0;border:0;overflow-wrap:anywhere}
  #security-events .access-table td+td{border-top:1px solid #e5ebf1}
  #security-events .access-table td::before{font-size:12px;color:#708397;font-weight:700}
  #security-events .access-table td:nth-child(1)::before{content:'Дата'}
  #security-events .access-table td:nth-child(2)::before{content:'Категория'}
  #security-events .access-table td:nth-child(3)::before{content:'Уровень'}
  #security-events .access-table td:nth-child(4)::before{content:'Сотрудник'}
  #security-events .access-table td:nth-child(5)::before{content:'Причина'}
}
