.ap-view { max-width: 1600px; margin: 0 auto; color: #172033; }
.ap-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 18px; }
.ap-search { width: min(340px, 34vw); height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.ap-search svg { width: 19px; color: #66758b; }
.ap-search input { width: 100%; border: 0; outline: 0; color: #26344a; font-size: 13px; }
.ap-toolbar > .button { height: 42px; padding-inline: 16px; }
.ap-add { background: var(--brand); border-color: var(--brand); }
.ap-layout { display: grid; grid-template-columns: minmax(620px, 1.18fr) minmax(430px, 1fr); gap: 16px; align-items: stretch; }
.ap-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.ap-list-card, .ap-profile-card { height: calc(100vh - 190px); min-height: 690px; }
.ap-list-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; }
.ap-tabs { display: flex; border-bottom: 1px solid var(--line); }
.ap-tabs button { position: relative; border: 0; background: none; color: #3b4960; font-size: 13px; font-weight: 650; white-space: nowrap; }
.ap-tabs button.is-active { color: var(--brand); }
.ap-tabs button.is-active::after { position: absolute; right: 12px; bottom: -1px; left: 12px; height: 2px; background: var(--brand); content: ''; }
.ap-account-tabs { min-height: 62px; }
.ap-account-tabs button { flex: 1; padding: 0 9px; }
.ap-table-wrap { flex: 1; min-height: 0; overflow: auto; }
.ap-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ap-table .col-user { width: 37%; }.ap-table .col-role { width: 20%; }.ap-table .col-unit { width: 21%; }.ap-table .col-status { width: 18%; }.ap-table .col-action { width: 4%; }
.ap-table th { height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); color: #526078; font-size: 12px; text-align: left; }
.ap-table td { height: 76px; padding: 8px 16px; border-bottom: 1px solid var(--line-soft); color: #344158; font-size: 13px; }
.ap-table td:last-child, .ap-table th:last-child { padding: 0 8px; text-align: center; }
.ap-user-row { cursor: pointer; transition: background .15s; }
.ap-user-row:hover { background: #f7faff; }
.ap-user-row.is-selected { background: #edf5ff; }
.ap-person { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ap-person > div { min-width: 0; }
.ap-person b, .ap-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-person b { color: #172033; font-size: 14px; }
.ap-person small { margin-top: 2px; color: #506079; font-size: 12px; }
.ap-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 40px; border-radius: 50%; background: var(--avatar); color: #fff; font-size: 13px; font-weight: 800; }
.ap-role { display: inline-flex; align-items: center; max-width: 100%; min-height: 23px; padding: 3px 7px; border: 1px solid; border-radius: 5px; font-size: 10px; font-weight: 800; line-height: 1.25; white-space: nowrap; }
.ap-role--director { border-color: #b997ff; background: #f6f0ff; color: #6c34d8; }.ap-role--deputy { border-color: #86b6ff; background: #f0f6ff; color: #1166d5; }.ap-role--manager { border-color: #8bd9aa; background: #effcf4; color: #178344; }.ap-role--leader { border-color: #ffbd8b; background: #fff6ef; color: #e45c00; }.ap-role--assistant { border-color: #f2d591; background: #fffaf0; color: #c78000; }.ap-role--storekeeper { border-color: #82d9ec; background: #effcff; color: #0089a8; }
.ap-department { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.ap-status i { width: 8px; height: 8px; border-radius: 50%; background: #12b75a; }
.ap-status.is-locked i { background: #a9b4c4; }.ap-status.is-inactive i { background: #db7b7b; }
.ap-status.is-pill { min-height: 25px; padding: 3px 9px; border: 1px solid #a5e6bf; border-radius: 999px; background: #edfbf3; color: #15924c; font-size: 11px; }
.ap-status.is-pill.is-locked { border-color: #d7dee7; background: #f3f5f8; color: #66758b; }.ap-status.is-pill.is-inactive { border-color: #efc5c5; background: #fff3f3; color: #b84a4a; }
.ap-more { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: none; color: #476078; font-size: 22px; }
.ap-more svg { width: 18px; height: 18px; }
.ap-more:hover { background: var(--brand-soft); }
.ap-empty { height: 180px; color: #738197; text-align: center; }
.ap-pagination { min-height: 72px; display: grid; grid-template-columns: 1fr auto 110px; align-items: center; gap: 12px; padding: 0 18px; color: #526078; font-size: 12px; }
.ap-pagination > div { display: flex; align-items: center; gap: 7px; }
.ap-pagination button { min-width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #516078; }
.ap-pagination button.is-current { border-color: var(--brand); background: #edf5ff; color: var(--brand); }
.ap-page-size { width: 100px; }

.ap-profile-card { min-width: 0; padding: 28px 25px; overflow: auto; }
.ap-profile-head { min-height: 112px; display: flex; align-items: flex-start; gap: 18px; }
.ap-avatar--large { width: 82px; height: 82px; flex-basis: 82px; font-size: 27px; }
.ap-profile-copy { min-width: 0; flex: 1; }.ap-profile-copy > div { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-profile-copy h2 { margin: 0; color: #111827; font-size: 20px; }.ap-profile-copy p { margin: 4px 0; color: #526078; font-size: 13px; }.ap-profile-copy svg { width: 15px; vertical-align: -3px; margin-right: 7px; }
.ap-edit { flex: 0 0 auto; }
.ap-profile-tabs button { padding: 15px 16px 12px; }.ap-profile-tabs button:first-child { padding-left: 0; }.ap-profile-tabs button:first-child::after { left: 0; }
.ap-profile-body { padding-top: 20px; }
.ap-general dl { display: grid; grid-template-columns: 175px 1fr; gap: 11px 12px; margin: 0; font-size: 13px; }.ap-general dt { color: #526078; }.ap-general dd { margin: 0; color: #26344a; }
.ap-divider { height: 1px; margin: 20px 0 17px; background: var(--line); }
.ap-general h3, .ap-permissions h3 { margin: 0 0 13px; font-size: 15px; }
.ap-hierarchy { position: relative; }.ap-level { position: relative; min-height: 58px; display: grid; grid-template-columns: 48px 165px 1fr; align-items: center; }.ap-level-icon { position: relative; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: #f5f0ff; color: #753de0; }.ap-level-icon svg { width: 19px; }.ap-level > b { font-size: 13px; }.ap-level > small { color: #64748b; font-size: 12px; }.ap-level > i { position: absolute; z-index: 0; top: 38px; left: 19px; width: 1px; height: 35px; background: #d9e1eb; }
.ap-level--deputy .ap-level-icon { background: #eff6ff; color: #0877ec; }.ap-level--manager .ap-level-icon { background: #effbf4; color: #16a255; }.ap-level--leader .ap-level-icon { background: #fff5ed; color: #f36b12; }.ap-level--assistant .ap-level-icon { background: #fff9e9; color: #eda900; }.ap-level--storekeeper .ap-level-icon { background: #edfbfd; color: #04a9be; }
.ap-permissions { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }.ap-permissions section { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }.ap-permissions label { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; color: #46556d; font-size: 13px; }.ap-permissions input { position: absolute; opacity: 0; }.ap-permissions label i { width: 34px; height: 19px; padding: 2px; border-radius: 12px; background: #cbd5e1; }.ap-permissions label i::after { width: 15px; height: 15px; display: block; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #8290a3; content: ''; }.ap-permissions input:checked + i { background: var(--brand); }.ap-permissions input:checked + i::after { margin-left: 15px; }.ap-permissions > p { grid-column: 1 / -1; color: #718096; font-size: 12px; }
.ap-activity > div { position: relative; display: flex; gap: 14px; padding: 0 0 22px 4px; }.ap-activity > div > i { width: 11px; height: 11px; margin-top: 5px; border: 3px solid #dbeafe; border-radius: 50%; background: var(--brand); }.ap-activity > div:not(:last-child)::after { position: absolute; top: 16px; bottom: 0; left: 9px; width: 1px; background: #dfe6ef; content: ''; }.ap-activity span > * { display: block; }.ap-activity small { color: #78869b; font-size: 11px; }.ap-activity p { margin: 3px 0; color: #526078; font-size: 13px; }
.ap-account-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }.ap-danger { border-color: #e7b5b5; color: #bd3d3d; }

.ap-filter-wrap { position: relative; }.ap-filter-popover { position: absolute; z-index: 12; top: 49px; right: 0; width: 290px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 14px 35px rgba(24, 39, 59, .16); }.ap-filter-popover label { display: grid; gap: 5px; margin-bottom: 10px; color: #526078; font-size: 12px; }.ap-filter-popover select { height: 40px; padding: 0 9px; }.ap-filter-popover button { width: 100%; }
.ap-modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; }.ap-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); }.ap-modal-box { position: relative; width: min(650px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 10px; background: #fff; box-shadow: 0 24px 70px rgba(15, 23, 42, .3); }.ap-modal-box header { display: flex; justify-content: space-between; padding: 21px 24px 16px; border-bottom: 1px solid var(--line); }.ap-modal-box h2 { margin: 0; font-size: 20px; }.ap-modal-box header p { margin: 4px 0 0; color: #6b7a90; font-size: 12px; }.ap-modal-box header button { width: 34px; height: 34px; border: 0; border-radius: 6px; background: none; font-size: 27px; }.ap-modal-box header button:hover { background: #f1f5f9; }
.ap-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 22px 24px; }.ap-field { display: grid; gap: 6px; color: #435168; font-size: 13px; font-weight: 650; }.ap-field input, .ap-field select, .ap-field textarea { width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: #26344a; resize: vertical; }.ap-field small { color: #718096; font-size: 11px; font-weight: 400; }.ap-field--wide { grid-column: 1 / -1; }.ap-modal-box footer { display: flex; justify-content: flex-end; gap: 10px; padding: 15px 24px; border-top: 1px solid var(--line); }.ap-form-error { padding: 9px 11px; border: 1px solid #efc2c2; border-radius: 6px; background: #fff1f1; color: #b73535; font-size: 12px; }.ap-form-error[hidden] { display: none; }.ap-modal-spacer { flex: 1; }

.ap-screen-state { min-height: 360px; display: grid; place-content: center; padding: 35px; text-align: center; }.ap-screen-state h2 { margin: 0 0 8px; }.ap-screen-state p { max-width: 620px; color: #64748b; }.ap-screen-state .button { margin: 12px auto 0; }.ap-screen-state.is-error { border-color: #edcaca; background: #fffafa; }
.ap-main-tabs { display: flex; gap: 28px; margin: -6px 0 18px; border-bottom: 1px solid var(--line); }.ap-main-tabs button { position: relative; padding: 11px 2px 13px; border: 0; background: none; color: #526078; font-size: 14px; font-weight: 700; }.ap-main-tabs button.is-active { color: var(--brand); }.ap-main-tabs button.is-active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--brand); content: ''; }
.ap-role-toolbar { justify-content: space-between; }.ap-role-toolbar h2 { margin: 0; font-size: 18px; }.ap-role-toolbar p { margin: 3px 0 0; color: #64748b; font-size: 12px; }.ap-roles-card { overflow: hidden; }.ap-role-table-wrap { overflow: auto; }.ap-role-table { width: 100%; min-width: 900px; border-collapse: collapse; }.ap-role-table th, .ap-role-table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); text-align: left; }.ap-role-table th { background: #f7f9fc; color: #526078; font-size: 12px; text-transform: uppercase; }.ap-role-table td { font-size: 13px; }.ap-role-table td:first-child { max-width: 260px; }.ap-role-table td:first-child b, .ap-role-table td:first-child small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.ap-role-table td:first-child small { color: #7a8799; font-size: 11px; }.ap-role-table code { padding: 3px 6px; border-radius: 4px; background: #f1f5f9; color: #42526a; font-size: 11px; }.ap-role-edit { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.ap-role-modal .ap-modal-box { width: min(780px, 100%); }.ap-capability-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }.ap-capability-editor > h3, .ap-capability-editor > .ap-sensitive-warning { grid-column: 1 / -1; }.ap-capability-editor > h3 { margin: 4px 0 10px; font-size: 14px; text-transform: uppercase; }.ap-capability-editor section { padding: 13px; border: 1px solid var(--line); border-radius: 7px; }.ap-capability-editor h4 { margin: 0 0 8px; font-size: 13px; }.ap-capability-editor label { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: #46556d; font-size: 12px; font-weight: 500; }.ap-capability-editor input { width: 16px; height: 16px; }.ap-capability-editor em { margin-left: 6px; padding: 2px 5px; border-radius: 4px; background: #fff1e8; color: #c25d19; font-size: 10px; font-style: normal; }.ap-sensitive-warning { padding: 10px 12px; border: 1px solid #f3c589; border-radius: 6px; background: #fff8e9; color: #a86012; font-size: 12px; }.ap-sensitive-warning[hidden] { display: none; }

@media (max-width: 1100px) { .ap-layout { grid-template-columns: 1fr; }.ap-list-card, .ap-profile-card { height: auto; min-height: 650px; } }
@media (max-width: 700px) { .ap-toolbar { justify-content: stretch; flex-wrap: wrap; }.ap-toolbar > .button, .ap-filter-wrap, .ap-filter-wrap > .button { flex: 1; }.ap-add { flex: 2; }.ap-search { width: 100%; }.ap-table-wrap { overflow-x: auto; }.ap-table { min-width: 680px; }.ap-pagination { grid-template-columns: 1fr auto; }.ap-pagination > div { display: none; }.ap-profile-head { flex-wrap: wrap; }.ap-edit { margin-left: auto; }.ap-profile-tabs { overflow-x: auto; }.ap-general dl { grid-template-columns: 140px 1fr; }.ap-level { grid-template-columns: 44px 115px 1fr; }.ap-form-grid, .ap-capability-editor { grid-template-columns: 1fr; }.ap-field--wide, .ap-capability-editor > h3, .ap-capability-editor > .ap-sensitive-warning { grid-column: auto; } }
