/* ============ Page-specific ============ */
.ap-card{background:var(--ap-surface); border:1px solid var(--ap-border); border-radius:var(--ap-radius); box-shadow:var(--ap-shadow);}
.ap-card-head{padding:1.1rem 1.25rem; border-bottom:1px solid var(--ap-border);}
.ap-card-body{padding:1.25rem;}
.btn-ap-primary{background:var(--ap-primary); border-color:var(--ap-primary); color:#fff; font-weight:600; font-size:.85rem;}
.btn-ap-primary:hover{background:var(--ap-primary-600); border-color:var(--ap-primary-600); color:#fff;}
.btn-ap-light{background:var(--ap-bg); border-color:var(--ap-border); color:var(--ap-text-strong); font-weight:600; font-size:.85rem;}
.btn-ap-light:hover{background:var(--ap-border);}

/* Stat cards */
.ap-stat{padding:1.2rem 1.35rem; display:flex; align-items:center; gap:1rem;}
.ap-stat-icon{width:44px; height:44px; border-radius:var(--ap-radius-sm); display:flex; align-items:center; justify-content:center; font-size:1.2rem; flex-shrink:0;}
.ap-stat-label{font-size:.78rem; color:var(--ap-secondary); font-weight:600;}
.ap-stat-value{font-size:1.35rem; font-weight:800; color:var(--ap-text-strong); letter-spacing:-.02em;}

/* Role cards */
.ap-role-card{border:1px solid var(--ap-border); border-radius:var(--ap-radius-sm); padding:1rem; height:100%; cursor:pointer; transition:border-color .15s ease, background .15s ease;}
.ap-role-card:hover{border-color:var(--ap-primary);}
.ap-role-card.active{border-color:var(--ap-primary); background:var(--ap-primary-100);}
.ap-role-icon{width:38px; height:38px; border-radius:var(--ap-radius-sm); display:flex; align-items:center; justify-content:center; font-size:1.05rem; margin-bottom:.6rem;}
.ap-role-name{font-weight:700; color:var(--ap-text-strong); font-size:.87rem;}
.ap-role-count{font-size:.75rem; color:var(--ap-secondary);}

/* Filters */
.ap-filter-input, .ap-filter-select{background:var(--ap-bg); border:1px solid var(--ap-border); border-radius:var(--ap-radius-sm); font-size:.83rem; color:var(--ap-text-strong); padding:.5rem .75rem;}
.ap-filter-input:focus, .ap-filter-select:focus{outline:none; border-color:var(--ap-primary); background:var(--ap-surface);}

/* Table */
.ap-table thead th{font-size:.72rem; color:var(--ap-secondary); font-weight:700; border-bottom:1px solid var(--ap-border); padding:.75rem .6rem; white-space:nowrap;}
.ap-table tbody td{padding:.85rem .6rem; border-bottom:1px solid var(--ap-border); vertical-align:middle; font-size:.85rem; color:var(--ap-text);}
.ap-table tbody tr:last-child td{border-bottom:none;}
.ap-table tbody tr:hover{background:var(--ap-bg);}
.ap-avatar{width:36px; height:36px; border-radius:50%; object-fit:cover;}
.ap-cell-strong{color:var(--ap-text-strong); font-weight:600;}
.ap-cell-sub{font-size:.76rem; color:var(--ap-secondary);}
.ap-role-badge{font-size:.72rem; font-weight:700; padding:.28rem .6rem; border-radius:6px;}
.role-Administrator{background:var(--ap-primary-100); color:var(--ap-primary);}
.role-Manager{background:var(--ap-info-100); color:var(--ap-info);}
.role-Editor{background:var(--ap-success-100); color:var(--ap-success);}
.role-Sales{background:var(--ap-warning-100); color:var(--ap-warning);}
.role-Support{background:#F1F5F9; color:#475569;}
[data-theme="dark"] .role-Support{background:#232C42; color:#93A0B8;}
.ap-badge{font-size:.72rem; font-weight:700; padding:.32rem .6rem; border-radius:20px; display:inline-flex; align-items:center; gap:.3rem;}
.ap-badge.success{background:var(--ap-success-100); color:var(--ap-success);}
.ap-badge.warning{background:var(--ap-warning-100); color:var(--ap-warning);}
.ap-badge.danger{background:var(--ap-danger-100); color:var(--ap-danger);}
.ap-badge .bi{font-size:.5rem;}
.ap-status-dot{width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:.4rem;}
.ap-row-check{cursor:pointer;}
.ap-action-btn{width:32px; height:32px; border-radius:var(--ap-radius-sm); border:1px solid var(--ap-border); background:var(--ap-surface); color:var(--ap-secondary); display:inline-flex; align-items:center; justify-content:center;}
.ap-action-btn:hover{background:var(--ap-bg); color:var(--ap-text-strong);}

/* Permission matrix */
.ap-perm-table{width:100%; border-collapse:collapse;}
.ap-perm-table th, .ap-perm-table td{padding:.6rem .7rem; border-bottom:1px solid var(--ap-border); font-size:.83rem;}
.ap-perm-table th{color:var(--ap-secondary); font-weight:700; font-size:.72rem; text-align:center;}
.ap-perm-table th:first-child, .ap-perm-table td:first-child{text-align:left; color:var(--ap-text-strong); font-weight:600;}
.ap-perm-table td{text-align:center;}
.form-check-input{cursor:pointer;}

.modal-content{border-radius:var(--ap-radius); border:1px solid var(--ap-border); background:var(--ap-surface);}
.modal-header, .modal-footer{border-color:var(--ap-border);}
.form-label{font-size:.82rem; font-weight:600; color:var(--ap-text-strong);}
.form-control, .form-select{background:var(--ap-bg); border:1px solid var(--ap-border); border-radius:var(--ap-radius-sm); font-size:.85rem; color:var(--ap-text-strong);}
.form-control:focus, .form-select:focus{border-color:var(--ap-primary); box-shadow:0 0 0 3px var(--ap-primary-100);}
