/* --- CONTAINER & LAYOUT --- */
.hms-permission-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* --- ROLE SELECTOR CARD --- */
.hms-role-selector-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- ACCORDION GROUP --- */
.hms-perm-group {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hms-perm-group.active {
    border-color: var(--hms-primary);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* --- GROUP HEADER --- */
.hms-perm-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: #fff;
    user-select: none;
}

.hms-perm-header:hover {
    background: #f8fafc;
}

.hms-perm-title {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hms-perm-icon {
    color: #94a3b8;
    transition: transform 0.3s ease;
}

.hms-perm-group.active .hms-perm-icon {
    transform: rotate(180deg);
    color: var(--hms-primary);
}

/* --- BODY & CONTENT --- */
.hms-perm-body {
    display: none;
    padding: 10px 24px 24px 24px;
    border-top: 1px solid #f1f5f9;
    background: #ffffff;
}

/* --- MASTER TOGGLE ROW (The ★ Enable Tab) --- */
.hms-master-row {
    background: #f0fdf4 !important; /* Premium Soft Green */
    border: 1px solid #bbf7d0 !important;
    margin: 0 0 15px 0 !important;
    border-radius: 12px !important;
    padding: 16px 20px !important;
}

.hms-master-row .hms-perm-label {
    color: #166534 !important;
    font-weight: 700 !important;
    font-size: 14px;
    display: flex;
    align-items: center;
}

/* --- STANDARD TOGGLE ROWS --- */
.hms-perm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 10px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.hms-perm-row:hover:not(.hms-master-row) {
    background: #f8fafc;
    border-radius: 8px;
}

.hms-perm-row:last-child {
    border-bottom: none;
}

.hms-perm-label {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

/* --- PREMIUM SWITCH UI --- */
.hms-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.hms-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.hms-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.hms-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

input:checked + .hms-slider {
    background-color: var(--hms-primary);
}

input:checked + .hms-slider:before {
    transform: translateX(20px);
}

/* --- LOADER & SPINNER --- */
.hms-custom-spinner {
    border: 3px solid #f1f5f9;
    border-top: 3px solid var(--hms-primary);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    animation: hms-spin 0.8s linear infinite;
    margin: 20px auto;
}

@keyframes hms-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- PLACEHOLDER --- */
.hms-permission-placeholder {
    padding: 60px 20px;
    text-align: center;
    color: #94a3b8;
    background: #fff;
    border: 2px dashed #e2e8f0;
    border-radius: 16px;
}









.hms-perm-count-wrap {
    margin-left: auto;
    margin-right: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hms-perm-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 86px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
}

.hms-perm-count-badge.enabled-count {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.hms-perm-count-badge.disabled-count {
    background: #f8fafc;
    color: #64748b;
    border-color: #e2e8f0;
}

.hms-perm-header.hms-count-all {
    border-color: #10b981;
}

.hms-perm-header.hms-count-none {
    border-color: #e2e8f0;
}

.hms-perm-header.hms-count-partial {
    border-color: #f59e0b;
}

@media (max-width: 768px) {
    .hms-perm-header {
        align-items: flex-start;
        gap: 10px;
    }

    .hms-perm-count-wrap {
        width: 100%;
        margin-left: 34px;
        margin-right: 0;
        margin-top: 8px;
    }

    .hms-perm-count-badge {
        min-width: auto;
        font-size: 10px;
        padding: 6px 9px;
    }
}




.hms-perm-count-badge.main-tab-count {
    min-width: 128px;
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}

.hms-perm-count-badge.main-tab-count.main-enabled {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.hms-perm-count-badge.main-tab-count.main-disabled {
    background: #fff1f2;
    color: #be123c;
    border-color: #fecdd3;
}