/* ============================================================
   حوكمة نبراس — واجهة إدارة المستخدمين والصلاحيات الاحترافية
   نظام أدوار ومصفوفة صلاحيات بأسلوب ERP (كحلي + ذهبي)
   ============================================================ */

.nebras-users-modal {
    --nu-navy: #062e44;
    --nu-navy-2: #0a4d8c;
    --nu-gold: #d4af37;
    --nu-ink: #0d2233;
    --nu-line: rgba(10, 77, 140, 0.16);
    max-width: 1180px;
    width: min(96vw, 1180px);
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    color: var(--nu-ink);
    border-radius: 22px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 40px 120px rgba(4, 22, 40, 0.5);
}

/* رأس النافذة */
.nebras-users-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 26px;
    background:
        radial-gradient(120% 160% at 100% 0%, rgba(212, 175, 55, 0.22) 0%, rgba(212, 175, 55, 0) 55%),
        linear-gradient(135deg, var(--nu-navy) 0%, var(--nu-navy-2) 100%);
    color: #fff;
}

.nebras-users-head-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nebras-users-head-title > i {
    font-size: 1.7rem;
    color: var(--nu-gold);
    background: rgba(255, 255, 255, 0.08);
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.nebras-users-head h2 {
    margin: 0;
    font-size: 1.32rem;
    color: #fff;
}

.nebras-users-sub {
    margin: 4px 0 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.78);
    max-width: 720px;
}

.nebras-users-close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.nebras-users-close:hover {
    background: rgba(255, 80, 80, 0.85);
    transform: rotate(90deg);
}

/* شريط الأدوات */
.nebras-users-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 26px 6px;
}

.nebras-users-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--nu-line);
    background: #fff;
    color: var(--nu-navy-2);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
}

.nebras-users-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(10, 77, 140, 0.18);
}

.nebras-users-btn--primary {
    background: linear-gradient(135deg, var(--nu-navy-2) 0%, var(--nu-navy) 100%);
    color: #fff;
    border-color: transparent;
}

.nebras-users-btn--primary i {
    color: var(--nu-gold);
}

/* بطاقات الإحصائيات */
.nebras-users-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 16px 26px;
}

.nebras-users-stat {
    background: #fff;
    border: 1px solid var(--nu-line);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.nebras-users-stat::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--nu-gold), var(--nu-navy-2));
}

.nebras-users-stat i {
    color: var(--nu-navy-2);
    font-size: 1.05rem;
}

.nebras-users-stat strong {
    font-size: 1.5rem;
    color: var(--nu-ink);
    line-height: 1.1;
}

.nebras-users-stat span {
    font-size: 0.76rem;
    color: #5a6b7a;
}

/* ===== محرر المستخدم ===== */
.nebras-users-editor {
    padding: 6px 26px 0;
}

.nebras-editor-card {
    border: 1px solid var(--nu-line);
    border-radius: 20px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(6, 46, 68, 0.12);
    animation: nuEditorIn 0.28s ease;
}

@keyframes nuEditorIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.nebras-editor-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--role-accent, #0a4d8c) 0%, var(--nu-navy) 130%);
    color: #fff;
}

.nebras-editor-role-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 1.15rem;
    color: #fff;
}

.nebras-editor-bar h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
}

.nebras-editor-bar p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
}

.nebras-editor-x {
    margin-inline-start: auto;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.nebras-editor-x:hover { background: rgba(255, 80, 80, 0.8); }

.nebras-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 20px;
}

.nebras-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nebras-field--wide {
    grid-column: 1 / -1;
}

.nebras-field > span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--nu-navy-2);
}

.nebras-field input,
.nebras-field select {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--nu-line);
    background: #f8fbfe;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--nu-ink);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.nebras-field input:focus,
.nebras-field select:focus {
    outline: none;
    border-color: var(--nu-navy-2);
    box-shadow: 0 0 0 3px rgba(10, 77, 140, 0.12);
    background: #fff;
}

.nebras-field input:disabled,
.nebras-field select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.nebras-editor-hint {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: #6a7888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nebras-editor-hint i { color: var(--nu-navy-2); }

.nebras-editor-hint--lock {
    margin: 0 20px 20px;
    padding: 12px 16px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px dashed var(--nu-gold);
    border-radius: 12px;
    color: #8a6d10;
}

.nebras-editor-perms-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 20px 12px;
}

.nebras-editor-perms-head h4 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--nu-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nebras-editor-perms-head h4 i { color: var(--nu-gold); }

.nebras-editor-perms-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.nebras-editor-perms-actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 11px;
    border-radius: 9px;
    border: 1px solid var(--nu-line);
    background: #f4f8fc;
    color: var(--nu-navy-2);
    font-family: inherit;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s;
}

.nebras-editor-perms-actions button:hover { background: #e6f0fa; }

/* شبكة الصلاحيات */
.nebras-perm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    padding: 0 20px 18px;
}

.nebras-perm-card {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--nu-line);
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, transform 0.12s;
    position: relative;
}

.nebras-perm-card:hover { transform: translateY(-2px); border-color: var(--nu-navy-2); }

.nebras-perm-card.is-on {
    background: linear-gradient(180deg, rgba(10, 77, 140, 0.06), rgba(212, 175, 55, 0.06));
    border-color: var(--nu-navy-2);
}

.nebras-perm-card input {
    grid-row: 1 / span 2;
    align-self: center;
    width: 20px;
    height: 20px;
    accent-color: var(--nu-navy-2);
    cursor: pointer;
}

.nebras-perm-card > i {
    display: none;
}

.nebras-perm-card-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--nu-ink);
}

.nebras-perm-card-desc {
    font-size: 0.72rem;
    color: #6a7888;
    line-height: 1.4;
}

.nebras-perm-groups {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 20px 12px;
}

.nebras-perm-group-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--nu-line);
    color: var(--nu-navy);
}

.nebras-perm-group-head h5 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 700;
}

.nebras-perm-grid--group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.nebras-editor-footer {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--nu-line);
    background: #f8fbfe;
}

/* ===== شبكة بطاقات المستخدمين ===== */
.nebras-users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    padding: 18px 26px 28px;
    list-style: none;
    margin: 0;
}

.nebras-users-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #6a7888;
    padding: 30px;
    font-size: 0.9rem;
}

.nebras-user-card {
    border: 1px solid var(--nu-line);
    border-radius: 18px;
    background: #fff;
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(6, 46, 68, 0.07);
    transition: transform 0.18s, box-shadow 0.18s;
}

.nebras-user-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(6, 46, 68, 0.14);
}

.nebras-user-card::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 4px;
    background: var(--role-accent, #0a4d8c);
}

.nebras-user-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.nebras-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.15rem;
    background: var(--role-accent, #0a4d8c);
    flex-shrink: 0;
}

.nebras-user-id {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nebras-user-id strong {
    font-size: 1rem;
    color: var(--nu-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nebras-user-id span {
    font-size: 0.74rem;
    color: #8090a0;
}

.nebras-user-primary {
    margin-inline-start: auto;
    font-size: 0.68rem;
    font-weight: 800;
    color: #8a6d10;
    background: rgba(212, 175, 55, 0.16);
    border: 1px solid var(--nu-gold);
    padding: 4px 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.nebras-user-role {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--role-accent, #0a4d8c);
    margin-bottom: 8px;
}

.nebras-user-branch {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    color: #4a5a6a;
    background: #f0f5fa;
    border-radius: 8px;
    padding: 5px 10px;
    margin-bottom: 10px;
}

.nebras-user-branch--all { color: #6a7888; }

.nebras-user-perms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    min-height: 26px;
}

.nebras-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--nu-navy-2);
    background: #eef4fa;
    border: 1px solid var(--nu-line);
    border-radius: 7px;
    padding: 4px 8px;
}

.nebras-user-chip i { font-size: 0.65rem; opacity: 0.8; }

.nebras-user-chip--all {
    color: #8a6d10;
    background: rgba(212, 175, 55, 0.14);
    border-color: var(--nu-gold);
}

.nebras-user-chip--none {
    color: #b0392b;
    background: rgba(192, 57, 43, 0.08);
    border-color: rgba(192, 57, 43, 0.3);
}

.nebras-user-card-foot {
    display: flex;
    gap: 8px;
    border-top: 1px solid var(--nu-line);
    padding-top: 12px;
}

.nebras-user-act {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid var(--nu-line);
    background: #f8fbfe;
    color: var(--nu-navy-2);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
}

.nebras-user-act:hover { background: var(--nu-navy-2); color: #fff; }

.nebras-user-act--danger { color: #c0392b; }

.nebras-user-act--danger:hover { background: #c0392b; color: #fff; }

/* استجابة الموبايل */
@media (max-width: 768px) {
    .nebras-users-stats { grid-template-columns: repeat(2, 1fr); }
    .nebras-editor-grid { grid-template-columns: 1fr; }
    .nebras-users-head { flex-direction: row; align-items: flex-start; }
    .nebras-users-head h2 { font-size: 1.1rem; }
    .nebras-users-sub { font-size: 0.76rem; }
    .nebras-perm-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .nebras-perm-grid { grid-template-columns: 1fr; }
    .nebras-users-grid { grid-template-columns: 1fr; padding: 16px; }
}

/* ============================================================
   NebrasERP — وحدات تشغيلية (إنتاج · مشتريات · محاسبة · أسعار · عروض)
   ============================================================ */
.nebras-erp-modal {
    --nu-navy: #062e44;
    --nu-navy-2: #0a4d8c;
    --nu-gold: #d4af37;
    --nu-ink: #0d2233;
    --nu-line: rgba(10, 77, 140, 0.16);
    max-width: 1080px;
    width: min(96vw, 1080px);
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
    color: var(--nu-ink);
    border-radius: 22px;
    padding: 0 0 22px;
    overflow: hidden;
    box-shadow: 0 40px 120px rgba(4, 22, 40, 0.5);
}

.nebras-erp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--nu-navy) 0%, var(--nu-navy-2) 100%);
    color: #fff;
}

.nebras-erp-head-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.nebras-erp-head-title > i {
    font-size: 1.4rem;
    color: var(--nu-gold);
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.35);
}

.nebras-erp-head h2 { margin: 0; font-size: 1.18rem; color: #fff; }
.nebras-erp-head p { margin: 3px 0 0; font-size: 0.78rem; color: rgba(255, 255, 255, 0.78); }

.nebras-erp-subhead {
    margin: 18px 24px 8px;
    font-size: 0.95rem;
    color: var(--nu-ink);
    display: flex;
    align-items: center;
    gap: 8px;
}
.nebras-erp-subhead i { color: var(--nu-gold); }

.nebras-erp-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px 4px;
}

.nebras-erp-stats--kpi { display: grid; grid-template-columns: repeat(4, 1fr); }

.erp-stat {
    flex: 1;
    min-width: 130px;
    background: #fff;
    border: 1px solid var(--nu-line);
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    overflow: hidden;
}
.erp-stat::before {
    content: "";
    position: absolute;
    inset-inline-start: 0; top: 0; bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--nu-gold), var(--nu-navy-2));
}
.erp-stat strong { font-size: 1.3rem; color: var(--nu-ink); line-height: 1.15; }
.erp-stat span { font-size: 0.74rem; color: #5a6b7a; }
.erp-stat--accent::before { background: linear-gradient(180deg, #1b9e57, #0a4d8c); }
.erp-stat--ok strong { color: #1b9e57; }
.erp-stat--danger strong { color: #c0392b; }

.nebras-erp-form {
    margin: 12px 24px;
    padding: 16px;
    border: 1px solid var(--nu-line);
    border-radius: 16px;
    background: #fff;
}

.erp-form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.erp-form-grid--line { grid-template-columns: 2fr 1fr 1fr auto; align-items: end; margin-top: 12px; }

.erp-form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.erp-total-hint {
    font-weight: 800;
    color: var(--nu-navy-2);
    margin-inline-end: auto;
}

.erp-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--nu-navy-2);
}
.erp-check input { width: 18px; height: 18px; accent-color: var(--nu-navy-2); }

.nebras-erp-list { margin: 8px 24px 0; display: flex; flex-direction: column; gap: 8px; }

.erp-empty { color: #6a7888; text-align: center; padding: 22px; font-size: 0.88rem; }

.erp-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--nu-line);
    border-radius: 13px;
    background: #fff;
}
.erp-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.erp-row-main strong { font-size: 0.92rem; color: var(--nu-ink); }
.erp-row-main small { font-size: 0.74rem; color: #6a7888; }
.erp-row-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.erp-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--nu-navy-2);
    background: #eef4fa;
    border: 1px solid var(--nu-line);
    border-radius: 6px;
    padding: 2px 7px;
}
.erp-tag--line { color: #8a6d10; background: rgba(212, 175, 55, 0.14); border-color: var(--nu-gold); }
.erp-tag--ok { color: #1b9e57; background: rgba(27, 158, 87, 0.1); border-color: rgba(27, 158, 87, 0.35); }
.erp-tag--status-received { color: #1b9e57; background: rgba(27, 158, 87, 0.1); }
.erp-tag--status-paid { color: #0a4d8c; background: rgba(10, 77, 140, 0.1); }
.erp-tag--status-pending { color: #c07a00; background: rgba(212, 137, 0, 0.12); }
.erp-tag--status-confirmed { color: #0a4d8c; background: rgba(10, 77, 140, 0.1); }
.erp-tag--status-production { color: #6b21a8; background: rgba(107, 33, 168, 0.1); }
.erp-tag--status-ready { color: #1b9e57; background: rgba(27, 158, 87, 0.1); }
.erp-tag--status-shipped { color: #0369a1; background: rgba(3, 105, 161, 0.1); }
.erp-tag--status-delivered { color: #166534; background: rgba(22, 101, 52, 0.12); }
.erp-tag--status-cancelled { color: #991b1b; background: rgba(153, 27, 27, 0.1); }
.erp-tag--action { cursor: pointer; border-color: var(--nu-navy-2); }
.erp-tag--action:hover { background: var(--nu-navy-2); color: #fff; }

.erp-row--alert { border-color: rgba(192, 57, 43, 0.35); background: rgba(192, 57, 43, 0.04); }
.erp-row--muted { opacity: 0.72; }

.sales-quote-inbox-item { align-items: flex-start; }
.sales-quote-inbox-thumb { flex-shrink: 0; }
.sales-quote-inbox-item .sales-quote-door-thumb img {
    width: 64px; height: 64px; object-fit: cover; border-radius: 10px;
}
.erp-stat--alert strong { color: #c0392b; }
.erp-row-actions-inline { display: flex; gap: 6px; flex-shrink: 0; }
.erp-row-actions-inline button {
    width: 34px; height: 34px; border-radius: 9px;
    border: 1px solid var(--nu-line); background: #fff; color: var(--nu-navy-2); cursor: pointer;
}
.erp-row-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.erp-row-qty {
    font-weight: 800;
    color: var(--nu-navy-2);
    font-size: 0.95rem;
    white-space: nowrap;
}
.erp-row-qty small { font-weight: 600; color: #6a7888; font-size: 0.7rem; }

.erp-row-del {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid rgba(192, 57, 43, 0.3);
    background: rgba(192, 57, 43, 0.06);
    color: #c0392b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.18s, color 0.18s;
}
.erp-row-del:hover { background: #c0392b; color: #fff; }

/* بناء عرض السعر */
.erp-quote-lines { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.erp-quote-totals {
    border-top: 1px dashed var(--nu-line);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.erp-quote-totals > div { display: flex; justify-content: space-between; font-size: 0.85rem; color: #5a6b7a; }
.erp-quote-totals strong { color: var(--nu-ink); }
.erp-quote-grand { font-size: 1rem !important; }
.erp-quote-grand span, .erp-quote-grand strong { color: var(--nu-navy-2) !important; font-weight: 800; }

@media (max-width: 768px) {
    .erp-form-grid { grid-template-columns: 1fr 1fr; }
    .erp-form-grid--line { grid-template-columns: 1fr 1fr; }
    .nebras-erp-stats--kpi { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .erp-form-grid { grid-template-columns: 1fr; }
}


/* Phase 19 — User governance */
.gov-user-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}
.gov-user-badge--on { background: #e8f8ef; color: #1e7e45; }
.gov-user-badge--off { background: #fdecea; color: #c0392b; }
.gov-user-badge--live { background: #e3f2fd; color: #1565c0; }
.gov-user-badge--live i { font-size: 0.5rem; animation: gov-pulse 1.2s infinite; }
.gov-user-badge--away { background: #f4f6f8; color: #6a7888; }
@keyframes gov-pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.nebras-user-card--inactive { opacity: 0.72; border-style: dashed; }
.nebras-user-status-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

.nebras-users-stat--ok strong { color: #1e7e45; }
.nebras-users-stat--warn strong { color: #c0392b; }
.nebras-users-stat--live strong { color: #1565c0; }

.gov-users-presence-table-wrap {
    grid-column: 1 / -1;
    margin-top: 12px;
    overflow-x: auto;
    border: 1px solid var(--nu-line, #e2e8f0);
    border-radius: 12px;
    background: #fff;
}
.gov-users-presence-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.gov-users-presence-table th,
.gov-users-presence-table td {
    padding: 10px 12px;
    text-align: right;
    border-bottom: 1px solid #eef2f6;
}
.gov-users-presence-table th { background: #f8fafc; color: #1a5276; }

.gov-users-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin: 10px 0 14px;
    border-radius: 12px;
    border: 1px solid #d4e4f7;
    background: linear-gradient(135deg, #f0f7ff 0%, #fff 100%);
}
.gov-users-strip-stat strong { display: block; font-size: 1.2rem; color: #1a5276; }
.gov-users-strip-stat span { font-size: 0.75rem; color: #5a6b7a; }
.gov-users-strip-stat--ok strong { color: #1e7e45; }
.gov-users-strip-stat--warn strong { color: #c0392b; }
.gov-users-strip-stat--live strong { color: #1565c0; }
.gov-users-strip-btn {
    margin-right: auto;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #2980b9;
    background: #2980b9;
    color: #fff;
    cursor: pointer;
    font-size: 0.82rem;
}

.dashboard-role-specialization { margin: 0 0 10px; }
.gov-role-specialization {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    border-right: 4px solid var(--role-accent, #0a4d8c);
    background: #fff;
}
.gov-role-specialization > i { font-size: 1.4rem; color: var(--role-accent); margin-top: 2px; }
.gov-role-specialization strong { display: block; color: #1a365d; }
.gov-role-specialization span { font-size: 0.85rem; color: #4a5568; }
.gov-role-specialization small { display: block; font-size: 0.78rem; color: #718096; margin-top: 4px; }
