/* Admin modules (User Management, AI Credits, Role Management). Reuses the
   global .npi-* look from index.html; only what is new lives here. */

.adm-title-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.adm-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e3e8ea; margin-bottom: 16px; }
.adm-tab {
  background: none; border: none; padding: 10px 14px; font-size: 13px; font-weight: 600; color: #667;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-family: inherit;
}
.adm-tab:hover { color: #3897B6; }
.adm-tab.active { color: #3897B6; border-bottom-color: #3897B6; }

.adm-lock {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #7a6a1c;
  background: #fbf3d0; border-radius: 10px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}

/* status dropdown */
.adm-status-wrap { display: inline-block; }
.adm-status {
  font: inherit; font-size: 12.5px; padding: 5px 8px; border-radius: 6px; border: 1px solid #cfe4ea; background: #fff; cursor: pointer;
}
.adm-status-wrap.active .adm-status { color: #2e9a4e; border-color: #9fd4af; }
.adm-status-wrap.inactive .adm-status { color: #c24a4a; border-color: #e3b0b0; }
.adm-status:disabled { background: #f2f4f5; cursor: not-allowed; }

/* create / edit user form */
.adm-form-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .adm-form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-select { width: 100%; box-sizing: border-box; }

/* AI credits */
.adm-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
@media (max-width: 1100px) { .adm-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.adm-kpi { background: #fff; border: 1px solid #e8e8e8; border-radius: 10px; padding: 14px 16px; }
.adm-kpi-label { font-size: 10.5px; letter-spacing: .08em; font-weight: 700; color: #667; text-transform: uppercase; }
.adm-kpi-value { font-size: 26px; font-weight: 700; margin: 6px 0 2px; color: #1a1a2e; }
.adm-kpi-sub { font-size: 11.5px; color: #889; }
.adm-kpi-value.utilised { color: #e07b22; }
.adm-kpi-value.available { color: #2e9a4e; }
.adm-kpi-value.users { color: #3897B6; }
.adm-kpi-value.unassigned { color: #7b4fd1; }
.adm-user-cell { display: flex; align-items: center; gap: 10px; }
.adm-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: #3897B6; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.adm-usage { min-width: 130px; }
.adm-usage-bar { height: 5px; border-radius: 3px; background: #e6ecee; overflow: hidden; }
.adm-usage-bar > span { display: block; height: 100%; background: #3897B6; }
.adm-usage-bar.high > span { background: #d23b3b; }
.adm-usage-text { display: flex; justify-content: space-between; font-size: 10.5px; color: #889; margin-top: 3px; }
.adm-num { text-align: right; font-variant-numeric: tabular-nums; }
.adm-num.low { color: #d23b3b; font-weight: 600; }
.adm-num.ok { color: #2e9a4e; font-weight: 600; }
.adm-help { font-size: 11.5px; color: #889; margin-top: 4px; }

/* role editor */
.adm-section { background: #fff; border: 1px solid #e8e8e8; border-radius: 10px; margin-bottom: 18px; }
.adm-section-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; gap: 12px; }
.adm-section-title { font-size: 17px; font-weight: 600; color: #1a1a2e; }
.adm-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-matrix th { font-weight: 600; color: #556; text-align: center; padding: 8px 6px; width: 70px; font-size: 12px; }
.adm-matrix th:first-child, .adm-matrix td:first-child { text-align: left; width: auto; padding-left: 18px; }
.adm-matrix td { text-align: center; padding: 6px; border-top: 1px solid #f0f2f3; }
.adm-matrix tr.adm-group-row td { background: #f7fafb; font-weight: 600; font-size: 14px; border-top: 1px solid #e3e8ea; }
.adm-matrix tr.adm-group-row td:first-child { cursor: pointer; user-select: none; }
.adm-matrix tr.adm-item-row td:first-child { padding-left: 42px; color: #333; }
.adm-matrix .adm-chev { display: inline-block; transition: transform .15s; margin-right: 6px; vertical-align: middle; }
.adm-matrix .adm-chev.open { transform: rotate(180deg); }
.adm-matrix input[type=checkbox] { width: 16px; height: 16px; accent-color: #3897B6; cursor: pointer; }
.adm-matrix input[type=checkbox]:disabled { cursor: not-allowed; }
.adm-empty-row td { color: #889; font-size: 12.5px; padding: 10px 18px 12px 42px !important; text-align: left !important; font-style: italic; }
.adm-na { color: #c8d0d3; }
.adm-measure-tools { display: flex; align-items: center; gap: 10px; padding: 0 18px 10px; }
.adm-search {
  display: flex; align-items: center; gap: 6px; border: 1px solid #cfe4ea; border-radius: 6px; padding: 5px 8px; background: #fff; min-width: 240px;
}
.adm-search input { border: none; outline: none; font: inherit; font-size: 13px; flex: 1; }
.adm-measure-scroll { max-height: 440px; overflow-y: auto; }
.adm-matrix.measures th { width: 90px; white-space: nowrap; position: sticky; top: 0; background: #fff; z-index: 1; border-bottom: 1px solid #e3e8ea; }
.adm-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin: 4px 0 40px; }
.adm-locked-note {
  background: #fbf3d0; color: #6b5c14; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; margin-bottom: 14px;
}
.adm-count-note { font-size: 12px; color: #889; font-weight: 400; margin-left: 8px; }
/* avatar dropdown: role switcher (modules/admin/role-switcher.js) */
.user-role-current { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px 4px; font-size: 12px; color: #889; }
.user-role-current b { color: #1a1a2e; font-size: 13px; font-weight: 600; }
.user-role-chev { margin-left: auto; transition: transform .15s; }
.user-role-chev.open { transform: rotate(180deg); }
.user-role-list { max-height: 260px; overflow-y: auto; padding: 2px 0 6px; }
.user-role-option {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 16px 8px 20px; border: none; background: none;
  font: inherit; font-size: 13px; color: #333; cursor: pointer; text-align: left;
}
.user-role-option:hover { background: #f5f8fa; color: #3897B6; }
.user-role-option.on { font-weight: 600; color: #3897B6; }
.user-role-check { width: 14px; flex: none; color: #3897B6; }
.user-role-tag { margin-left: auto; font-size: 10.5px; color: #7a6a1c; background: #fbf3d0; border-radius: 8px; padding: 1px 7px; }
.user-role-empty { padding: 8px 20px; font-size: 12.5px; color: #889; }

.adm-placeholder { text-align: center; color: #889; padding: 60px 0; font-size: 14px; }
